PrepZone Logo
PrepZone
Back to Java

Java · Medium

Difference between notify() and notifyAll(). When is each appropriate?

JavaCore JavaConcurrency

Answer preview

notify() — Wakes up one arbitrary thread that is waiting on this object's monitor. The awakened thread competes for the lock and does not proceed until it re-acquires it.…