This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Threads and Synchronization and the fly likes calling notify() multiple times Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "calling notify() multiple times" Watch "calling notify() multiple times" New topic
Author

calling notify() multiple times

Michael Remijan
Ranch Hand

Joined: May 29, 2002
Posts: 103

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


<a href="http://www.linkedin.com/in/mjremijan" rel="nofollow">
<img src="http://www.linkedin.com/img/webpromo/btn_viewmy_160x25.png" border="0" >
</a>
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
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: calling notify() multiple times
 
Similar Threads
Thread Q from Khalid Q.44
Difference between Notify and NotifyAll
join()?
Thread
Can notify() be called on a thread that has not started yet?