Waiting time measures how long a thread is blocked instead of executing. It can reveal performance costs that a count of lock events alone misses. section 9.3
Compare lock counts with waiting time
In a producer-consumer example, adding wait/notify reduces the number of locks but increases waiting time and total execution time. Sampling and profiling expose the tradeoff; JProfiler can show both lock counts and waiting time grouped by thread. section 9.3
Figure 9.14 Locked threads versus waiting threads. A locked thread is blocked at the entrance of a synchronized block. The monitor won’t allow a thread to enter a synchronized block while another thread actively runs inside the block. A waiting thread is a thread that the monitor has explicitly set to the blocked state. The monitor can make any thread inside the synchronized block it manages wait. The waiting thread can continue its execution only after the monitor explicitly tells it that it can proceed with its execution.
Distinguishes a thread waiting at a synchronized block from one explicitly put into the waiting state by the monitor. section 9.3
