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

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">