[Logo]
Forums Register Login
Confused on how notify() works
(1 like)
It is said that when notify() is called, only one thread in waiting pool wakes up. Does that mean rest of the threads (all others in waiting) are stuck and don't get to wake up ever??
How do the other threads in waiting get a chance to finish their work then?

Thanks in advance!
 
Ai Ayumi wrote:It is said that when notify() is called, only one thread in waiting pool wakes up. Does that mean rest of the threads (all others in waiting) are stuck and don't get to wake up ever??


It means they're stuck and don't get to wake up until notify() is called again, as many times as there are waiting threads, or until notifyAll() is called.

Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards



All times above are in ranch (not your local) time.
The current ranch time is
Nov 17, 2017 21:53:31.