notify() vs notifyAll()
notify() awakens at most one thread.
notifyAll() awakens all threads blocked on the lock for the specified object.
Use notifyAll() when
- there are many threads to wake up simultaneously, or
- only one thread should continue but the determination of which one is up to the threads themselves.