The yield method in Threading

The yield() is  a static method in Thread class.It changes state of  a running thread to runnable state.This method can be applied to only those threads having the same priority.Now ,if there is a thread of same priority is waiting to get a chance to start running , it will move to running stage(The thread scheduler is managing it) .But practically  , we cannot assure the proper working of yield() method , since its implementation is different in different platforms and different JVMs.

See Related Discussions

Threading Basics

Thread Safety in Java

Thread Communication in Java

Thread Priorities in Java

The join() method in Threading

The sleep() method

Daemon Threads in Java

Thread pool executor in java

Thread pools in Java

Thread Dead lock in Java

Thread Live lock in Java