Hi Huiying,
There are
never any guarantees with threads
The JDK for <code>yield()</code> says:
Causes the currently executing thread object to temporarily pause
and allow other threads to execute.
It does not say wether the other thread must have the same, higher or lower priority ... just that it will cause the current thread to pause.
In the end, which thread runs depends on the the way the scheduler is implemented on the local system. As Win98 uses time-slicing, it's possible a lower priority thread could run. On systems that don't use time-slicing, a lower priority thread may not run given a yeild().
Hope that helps.
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform