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 aop(assepct oriented programing)?
what is a non-repeatable read?
What is the difference between session and entity beans?
How is a java object message delivered to a non-java client?
To what value is a variable of the string type automatically initialized?
how to use debug in my elipse to solve problems that exist in my project
what are memory considerations of jsp compares to other web components?
Can I use multiple html form elements with the same name?
What is the argument type of a programs main() method?
What is the purpose of the finally clause of a try-catch-finally statement?
What is the RMI and Socket?
which type of objects reference will be given to client?
Java is fully object oriented languages or not?
wahts is mean by dynavalidatorform in struts/
Why use a datasource when you can directly specify a connection details? (in a J2EE application)