A waiting thread has been told by its monitor to pause and can resume only after that same monitor notifies it. Unlike a locked thread, it is not merely waiting to enter a synchronized block. section 7.3
Waiting threads coordinate producer–consumer work without repeatedly testing an impossible condition. A consumer waits when the list is empty; a producer waits when the list reaches its capacity. section 7.3
Coordinating a shared list
Inside synchronized access to the shared list, the consumer removes a value and calls notifyAll(); when no value exists, it calls wait(). The producer follows the inverse rule: it adds values and notifies, but waits when the list already contains 100 values.
Waiting reduces how often threads are locked, but it can increase blocked time and slow total execution, so runtime observations still need interpretation.
