Tuesday, 14 February 2012

What is the difference between yielding and sleeping? | Java Threads


When a task invokes its yield() method, it returns to the ready state, either from waiting, running or after its creation. When a task invokes its sleep() method, it returns to the waiting state from a running state.

No comments: