A livelock is a concurrency failure in which tasks remain active but make no progress. They repeatedly acquire and release resources, politely yielding to one another instead of doing useful work. section 9.5
Livelock commonly appears when tasks compete for multiple shared resources:
- A task acquires one lock, discovers that another is unavailable, releases the first, and retries. section 9.5
- Competing tasks can repeatedly interfere with one another while the program state never advances. section 9.11
- Frequent retries can produce excessive context switching and reduce overall performance. section 9.5
- Ordering lock acquisition hierarchically can prevent this pattern by ensuring that tasks request resources in a consistent sequence. section 9.5
Two callers who keep hanging up
Imagine calling someone who is simultaneously calling you. You both hang up and try again at the same time, repeating the pattern without connecting. The dining-philosophers version behaves similarly: each philosopher grabs one chopstick, notices the other is unavailable, releases the first, and tries again. Neither philosopher eats. section 9.5


