hey stephen...
I am working on the "chat-lag" problem we encounter
whenever we have more than about 10-12 users logged on at ariadne
and I wanted to ask for some advice
from you or anyone who has ideas...
o background
whenever we have a "Break the Server Party"
I keep one window open
running a telnet seeion into ariadne
with "tail -f /tmp/VNetlogfile.log" going in the window
so I can watch as the server writes things to it's logfile
and I keep a second window open
running a web browser logged into ariadne's VNet server
so I can see what users are experiencing
o symptoms
we get more than 10-12 people logged on and chatting
and at some point
the avatars continue moving around
as evidenced by observing my screen
and messages continue to come in to the VUsers
as evidenced by "recd: " + VNet.VIP.msgToString(vid, field, value)
showing up in the log-tail window
but chat-text messages stop showing up in *everyone's* browsers
as evidenced by the comments arriving in the log-tail window
and then after a while all VUser's empty thier queues in a rush
I think that somewhere after the line in VUser.run which reads:
log("recd: " + VNet.VIP.msgToString(vid, field, value));
and somewhere before each of the WriterThreads dequeues and sends stuff
something is blocking *everything* somewhere along the line...
o what I am looking to try out
I am suspicious of communications between threads
being the cause of this symptom...
I may or may not be right ;^}
I was thinking of using a PipedOutputStream/PipedInputStream pair
but the more I thought about marshalling/unmarshalling the Messages
the less attractive I found the idea
now I am thinking about using the Observer/Observable pattern
something like this-a-way:
WriterThreadObserver could extend interface java.util.Observer
VObject could extend class java.util.Observable
WriterThread could implement interface java.util.Observer
VUser would then be both Observable and an Observer
when a VUser is created
it registers all other VUsers *and* it's own WriterThread as Observers
to send messages
instead of using writer.send(new Message(vid, field, value));
it uses notifyObservers(new Message(vid, field, value));
and it uses it's own update method to receive messages
from other VUsers
VUser takes incoming messages
from it's client and and from other VUsers and redistributes them
with notifyObservers(new Message(vid, field, value));
WriterThread takes incoming messages through it's own update method
and decides if it should queue the message or whatever
comments?
am I way "off base"??
jeffs
--
Jeff Sonstein, M.A. http://ariadne.iz.net/
http://ariadne.iz.net/~jeffs/jeffs.asc
==============================================
there are no bugs
there are just undocumented features