Purpose of the wait (), notify (), and notifyAll() methods

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 state

What 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.

Advantage of event-delegation model over the earlier event inheritance model?
Event-delegation model allows a separation between a component's design.....
Difference between Boolean & operator and the && operator
A & B In this, both the operands A as well as B are evaluated and then ‘&’ is applied to them...
What is a task's priority and how is it used in scheduling?
A priority is an integer value. Based on this priority the scheduler determines when to execute a task.....
Post your comment