On Wed, 24 Feb 1999, Chris Raser wrote:

> 
> On Wed, 24 Feb 1999, David Craig wrote:
> > Java doesn't define how threads of the same priority share cpu time In
> > some VM implementations the sharing is fair. On others, such as the port
> > you're probably using, one thread preempts the other indefinitely.
> > 
> > Congrats on an elegant workaround. :)
> > 
>       Actually, it's not my own invention, and I'm sure that others have
> done something similar.  All I did was create a thread of "MAX_PRIORITY"
> that just goes right to sleep.  It preempts everything else, then gives
> the little guys a chance to do their thing.  (and I write a minimum of
> extra code to keep everything moving)  Maybe "honorable hack" is a better
> term than "elegant".  <smile>
> 
>       Thanks for the info- my java-idealism was getting just a little
> out of controll there for a second... ;)
> 
>       -chris


I do not mean to rip on your code or anything, but if you require a
big hack like that then something must be wrong with the design of
the program. Please do not take that the wrong way. Why exactly do
your threads starve each other? Are they polling or something? Most
of the time a polling process can be replaced by a signal based
process and you will end up saving a lot of wasted CPU time.
Just a thought.

Mo DeJong
dejong at cs.umn.edu


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to