Deadlock vs Livelock vs Starvation
What you'll learn: How to distinguish between three related but distinct synchronization problems: deadlock, livelock, and starvation.
The Core Distinctions
While all three represent failures in concurrent systems, they differ fundamentally in why progress stops:
Deadlock is a permanent blocking situation. Processes are stuck waiting for resources held by each other in a circular chain. Nobody can proceed, ever. Think of two cars facing each other on a one-lane bridge—both wait indefinitely for the other to back up, but neither does.
Livelock looks active but makes no progress. Processes continuously change state and respond to each other, but these changes don't move them forward. Imagine those same two cars both politely backing up simultaneously, then both advancing again, then both backing up—forever. They're "doing something," but getting nowhere.
Starvation means a process waits indefinitely because other processes keep getting priority. The process could eventually run if circumstances change, but it keeps getting skipped. Picture a busy intersection where aggressive drivers keep cutting in front of a polite driver who never gets a turn—they're not blocked permanently, just perpetually overlooked.
Key Differences Summary
- Deadlock: Permanent block, no state changes, circular wait for resources
- Livelock: Active state changes, but no useful progress, mutual interference
- Starvation: Indefinite postponement due to scheduling/priority issues, technically still runnable
Real Impact
Deadlock requires external intervention (killing processes, restarting). Livelock might resolve if timing changes but wastes CPU cycles. Starvation can often be fixed with better scheduling policies like aging (gradually increasing priority).
Key Takeaway: Deadlock means frozen processes in circular wait; livelock means busy processes making no progress; starvation means one process perpetually deprioritized while others advance.