Home > DeveloperSection > Interviews > What methods java providing for Thread communications ?

Posted on    April-16-2011 1:03 AM

 Java Java 
 1 Answer(s)
  790  View(s)
Rate this:

Amit Singh

Total Post:565

Posted on    April-16-2011 12:00 AM

Java provides three methods that threads can use to communicate with each other: wait, notify, and notifyAll. These methods are defined for all Objects (not just Threads). The idea is that a method called by a thread may need to wait for some condition to be satisfied by another thread; in that case, it can call the wait method, which causes its thread to wait until another thread calls notify or notifyAll.

Don't want to miss updates? Please click the below button!

Follow MindStick