multithreading - Notification in Java thread synchronization -


when there multiple threads in waiting state; , if call notify() rather calling notifyall() 1 going notified among several threads in waiting state?

that's undefined behavior. picked up. javadoc:

if threads waiting on object, 1 of them chosen awakened. the choice arbitrary , occurs @ discretion of implementation.

and yes, can lead thread starvation.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -