Re: What you get is what you want
Quartz <[email protected]> Fri, 12 Nov 2004 09:47:45 -0800 (PST)
| Newsgroups | gmane.comp.java.seda.user |
|---|---|
| Message-ID | <[email protected]> |
> Maybe. I think that there is many ways to arvertise the TM that a
> thread is blocked in an enqueue operation.
But few or no other are safe and reusable.
safer: it is impossible to forget to unset the so said 'flag' upon return from the blocking action
method call.
reusable: It avoids the dependency from the queue implementation (stage management layer) to the
thread implementation (thread management layer).
Don't forget, the handler does the blocking_enqueue, not the thread runnable. I chose to make the
queue aware of the TM so that I don't have to code a blocking action in all of my handlers. But
they could need to do a blocking action too (there is the reuse). You certainly don't want the
handlers to fool around with a thread flag: murphy's law will kick in and careless implementation
will forget it (typically after an uncaught exception, because they might not use a finally{})
By the way, this is the most obvious fix that has to be done in sandstorm: the stages and thread
are not well isolated. I would add to that a very awfull lifecycle management.
Just writing about it, I'm exhausted.
I can't help but recall all the pain of hundreds of fixes I really had to make there, and in other
areas like config, apis, the completely inexistant interruption handling, and gracefull shutdowns
(part of life cycling).
Oh man... I hope you have an idea of what you are getting into.
> A more elaborate possibility could be to use the graph (with the help of
> StageGraph and StageEdge) of all stages to determine exactly where
> allocate and schedule our threads. Contrary to other proposed
> solutions, this one is proactive instead of reactive.
Computer system are always reactive. Think about it.
This would 'simply' be a reaction to the stage graph.
The only way to be proactive is by prediting the requirements of a stage and provisionning it
in advance with ressources. That means you read the future. If reading anything else, you are
reacting to a consign (user input, config, etc...), a plan (config) or a feedback.
__________________________________
Do you Yahoo!?
Check out the new Yahoo! Front Page.
www.yahoo.com
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click