|
drneau.com A discussion board for drneau.com
|
View previous topic :: View next topic |
Author |
Message |
drneau Site Admin
Joined: 13 Feb 2005 Posts: 2385 Location: Woodbury, MN
|
Posted: Tue Apr 05, 2005 8:27 pm Post subject: I'm a thread moron |
|
|
Look for coming improvements in the client/server robustness...
The way I did it for v1 (and copied for v2) worked, but I've come to the conclusion that it needs reworking.
Boring inner-working Java details to follow.
The problem is that all the following happens within one thread:
- Segment timer decrements "remaining time property"
- Property changes and notifies all property change listeners
- The "ConsoleDataModel" catches the change and notifies its listeners
- The server process catches that change and updates each client, one at a time
The problem here being that if a connection to a client hangs, then the server hangs. That, and it's just simply inefficient...
Under the new model, the following will happen in one thread:
- Segment timer decrements "remaining time property"
- Property changes and notifies all property change listeners
- The "ConsoleDataModel" catches the change and notifies its listeners
- The "ServerChangeListener" will catch the change and pop it onto its message stack.
...while the following happens in another thread:
- The "ServerStackWatcher" checks the stack for new messages.
- If a message is found, it is routed to the main server process which in turn pops the message onto each client's message stack.
- Each client watches its own stack. When a message is found, it gets routed.
This way, clients only hang themselves. _________________ --
Dr. Neau (not a real doctor)
http://drneau.com
http://home.comcast.net/~jneau |
|
Back to top |
|
|
drneau Site Admin
Joined: 13 Feb 2005 Posts: 2385 Location: Woodbury, MN
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|