What is the purpose of the wait (), notify (), and notifyAll() methods?wait() - causes the thread to pause for certain number of milli seconds or until it is notified.
notify() – A thread in wait state will be returned to running state
notifyAll() – All threads those are in wait state will be returned to running stateWhat is the purpose of the wait (), notify (), and notifyAll() methods?notify() Wakes up a single thread that is waiting on this object's monitor.
notifyAll() Wakes up all threads that are waiting on this object's monitor.
wait() Causes current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object.
|