wood burning stoves*
The moose likes Threads and Synchronization and the fly likes calling notify() multiple times Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "calling notify() multiple times" Watch "calling notify() multiple times" New topic
Author

calling notify() multiple times

Michael Remijan
Author
Ranch Hand

Joined: May 29, 2002
Posts: 120
    
    5

I want to have 1 thread waiting for a notify() call on an object. Does anyone know would happen to that thread if notify() was called a number of times? would the notify() calls be "queued" in some way so that instead of going back to sleep the thread would continually wake up for as many times as notify was called?
Thanks, Mike


Java EE Evangelist — Author, EJB 3 in Action 2nd Edition — Java Community Process Member
Jose Botella
Ranch Hand

Joined: Jul 03, 2001
Posts: 2120
notify() has no effect if there aren't waiting threads.


SCJP2. Please Indent your code using UBB Code
 
Don't get me started about those stupid light bulbs.
 
subject: calling notify() multiple times
 
Similar Threads
Can notify() be called on a thread that has not started yet?
Difference between Notify and NotifyAll
Thread
Thread Q from Khalid Q.44
join()?