A livelock is a concurrency failure in which threads keep executing but make no effective progress. At least two threads repeat a control-loop state independently of external input, so the program appears active while its work never advances. section 20.7
Detours that never escape
Imagine a vehicle entering a city block whose detours form a cycle. Each turn seems reasonable and traffic continues moving, but the vehicle circles forever. With multiple vehicles, changing arrival order, speed, or route can produce more complicated cycles that remain difficult to detect and prevent. section 15.4
Distinguish livelock from related threaded failures:
- Deadlock leaves threads blocked while waiting for locks or conditions; livelock leaves threads running through a repeating control loop. section 20.7
- Livelock prevention and detection require analyzing interactions among components, because threads may change order or route without escaping the cycle. section 15.4
- Proving that a practical threaded program has no livelock requires a case analysis of its possible state progression. section 15.4
Figure 15.1 A configuration potentially leading to a livelock
Use the configuration diagram to visualize how individually sensible detours can combine into a cyclic trap. section 15.4


