In Concurrent Programming in
Java (1.1.2.5), Doug Lea says
Thread.yield is a purely heuristic hint advising the JVM that if there are any other runnable but non-running threads, the scheduler should run one or more of these threads rather than the current thread. The JVM may interpret this hint in any way it likes.
On JVM implementations that employ pre-emptive scheduling policies, especially those on multiprocessors, it is possible and even desirable that the scheduler will simple ignore this hint provided by yield.
In The Java Programming Language (10.6.1), Arnold, Gosling and Holmes say yield
Provides a hint to the scheduler that the current thread need not run at the present time, so the scheduler may choose another thread to run. The scheduler may follow or ignore this suggestion as it sees fit--you can generally rely on the scheduler to "do the right thing" even though there is no specification of exactly what that is.
[ June 30, 2003: Message edited by: Marlene Miller ]