Sunday 2 March 2014

Thread notify

public final void notify()
Wakes up a single thread that is waiting on this object's monitor. Suppose more than one thread is waiting on this object's monitor, then only one thread gets notified, the way the thread chosen is totally implementation dependent.

public final void notifyAll()
Wakes up all threads that are waiting on this object's monitor. A thread waits on an object's monitor by calling one of the wait methods. Now all the awakened threads also in competition for the resource.

Thread wait: release resources                                                 Thread states                                                 Home

No comments:

Post a Comment