link mingle home | logged in as: guest | login/register| submit link


IndiaDiscuss.com : Social Bookmarkings and News Networking Site for India
java
Bookmarks
Java Quick Reference - Threads - notify() and notifyAll() methods

View Story
41
Votes

* the notify() and notifyAll() methods are defined in the Object class * they can only be used within synchronized code * notify() wakes up a single thread which is waiting on the object's lock * if there is more than one thread waiting, the choice is arbitrary ie there is no way to specify which waiting thread should be re-awakened * notifyAll() wakes up ALL waiting threads; the scheduler decides which one will run * if there are no waiting threads, the notifys are forgotten * only notifications that occur after a thread has moved to wait state will effect it; earlier notifies are irrelevant
http://www.janeg.ca/scjp/threads/notify.html
saved under Interview Questions/notify vs notifyAll by java

 
IndiaDiscuss | Published News | Hot
Indian Social News and Links Network
IndiaDiscuss | Published News
Indian Social News and Links Network