On Wed, 24 Feb 1999, Troy Wu wrote:

>     
> Moses,

That may work if you were using native threads but it may not
work if you are running under green threads. My point was
that if you design a program like this in Java you can never
but sure it is going to work on some unknown platform. If you
instead use the Thread.yield() method or the wait(), notify()
approach it will be a lot safer. I am not saying that there is
anything wrong with using a CPU bound thread or anything.

Mo DeJong
dejong at cs.umn.edu

> If I have two programs crunching FFTs (e.g.), then a preemtively
> multi-tasking OS can interrupt one process and run the other.  Linux
> is such an OS.  I don't think that it's wrong (e.g.) to run two
> threads concurrently, with at least one being CPU-bound.
> 
> BTW, does anyone know if the native-threads impl solves this
> scheduling problem?
> 
>       --troy
> 
>     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.
> 


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

Reply via email to