View Single Post
  #1 (permalink)  
Old 09-26-2008, 12:05 AM
denis denis is offline
Member
 
Join Date: Sep 2008
Posts: 4
denis is on a distinguished road
about wait() and notifyALL
hi everyone i have a question about using wait and notifyALL()
i am very confused about these two which i have never been able to use.

as per the API
wait() = Causes current thread to wait until either another thread invokes the notify() method or the notifyAll().
does the above wait() means that the current thread will wait as the monitor has already been in use by another thread. and will continue until the thread using the monitor releases the lock through notifyALL().

notifyall() = is notify all the threads waiting on the monitor.

i would really appreciate if somebody could post a simple code on wait and notifyALL().

thanks in advance.
Denis

Last edited by denis : 09-26-2008 at 12:07 AM.
Reply With Quote
Sponsored Links