Answer Posted / bindhu
Two threads can communicate with each other using
the wait() and notify() , notifyAl() methods. wait()
method tells the thread to wait until another threads
calls notify() method.
The wait() method causes the current thread to wait
(possibly forever) until another thread notifies it of a
condition change. We use wait() in conjunction with notify
() or notifyAll() to coordinate the activities of multiple
threads using the same resources.
The notifyAll() method notifies all the threads waiting on
the monitor held by the current thread and wakes them up.
Typically, one of the waiting threads will grab the monitor
and proceed.
Is This Answer Correct ? | 57 Yes | 8 No |
Post New Answer View All Answers
What do you mean by Socket Programming?
how to use debug in my elipse to solve problems that exist in my project
What is the purpose of the notify() method?
What are the sequence of steps to write pub or sub model kind of application?
What is re-entrant. Is session beans reentrant. Is entity beans reentrant?
Explain how will the struts know which action class to call when you submit a form?
Is “abc” a primitive value?
What are the difference between RMI and CORBA?
What is threadfactory?
What is in-memory replication?
Name the eight primitive java types.
How can I scroll through list of pages like the search results in google?
what is an isolation level?
Why do threads block on i/o?
Explain about thread synchronization inside a monitor?