Livelock
A livelock is threads constantly changing state in response to each other yet making no progress; they are not blocked but cannot complete the task.
Purpose
To understand the difference between livelock and deadlock and their defenses; a liveness defect in concurrent programs.
Mechanism
Threads keep yielding to each other (e.g., both release the lock so the other can take it), so no thread ever acquires the resource. Unlike deadlock: the threads are active but make no progress. Defenses: random backoff, priorities, retry limits.
Use cases
- Concurrency liveness analysis
- Livelock detection
- Concurrent design