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 is local interface. How values will be passed?
How messaging services are done, before release of JMS?
Which characters may be used as the second character of an identifier, but not as the first character of an identifier?
why static class in java
What is the difference between the session.update() method and the session.lock() method?
What is the difference between java class and bean?
Why does the tag url-encode javascript and mailto links?
What is abstract schema?
How to determine SGA site?
Difference between hashmap and hashtable?
For which statements does it make sense to use a label?
how do you Handle Front End Application data against DB with example?
Should synchronization primitives be used on bean methods?
What are the different class loaders used by jvm?
What is glasgow?