Saturday, June 7, 2008
What is the difference between notify and notifyAll method ?
notify wakes up a single thread that is waiting for object's monitor. If any threads are waiting on this object, one of them is chosen to be awakened. The choice is arbitrary and occurs at the discretion of the implementation. 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.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment