Actually, thread priorities work fine in Linux. The main difference has
to do with threads of the SAME priority level. In Windows, Java performs
time-slicing, that is, threads of the same priority share the CPU by
taking turns. In Linux, that is not the case. A thread that does not
relinquish control by blocking (e.g. an endless while loop), will
not only starve lower priority threads, but also threads with the
same priority.

Therefore, make sure that you either assign different priority levels,
or that busy threads take the time to invoke Thread.yield() from
time to time.

Alexander

On Thu, Feb 06, 2003 at 06:11:03PM -0500, Joseph Shraibman wrote:
> Masnizar jamian wrote:
> > 
> > I'm new to linux , so are there any difference between windows platform 
> > and linux in terms of coding (mainly in multithread)? Because I heard 
> > that a linux thread is different from windows thread. Could you 
> > recommend me any reading material that clear some cobweb in my brain ?
> > Thanks in advance for helping me.
> > 
> Thread priorities don't work in Linux, and neither does Thread.yield() (couldn't it 
>be 
> implimented as sleep(1)?)
> 
> 
> ----------------------------------------------------------------------
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]


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

Reply via email to