Difference Between Deadlock and Starvation in OS

In operating systems, both deadlock and starvation are unwanted situations that occur when processes requiring shared resources block each other's progress indefinitely. While both are undesirable conditions, deadlock and starvation have distinct characteristics and causes.

What is Deadlock?

A deadlock is a condition where no process can proceed for execution because each process is waiting for resources that have been acquired by other processes in the same deadlock set. In this situation, all involved processes become permanently blocked.

Deadlock is also known as circular wait because processes wait for resources in a circular chain. For deadlock to occur, four conditions must be present simultaneously: mutual exclusion, hold and wait, no preemption, and circular wait.

Deadlock Scenario P1 P2 R1 R2 Allocated Waiting for

What is Starvation?

Starvation occurs when a process requests a resource that is continuously being used by other higher-priority processes. The starving process remains ready to execute but waits indefinitely for the CPU to allocate the required resources. This typically happens in priority-based scheduling systems where low-priority processes are repeatedly bypassed.

Starvation can be resolved using the aging technique, which gradually increases the priority of waiting processes over time. Unlike deadlock, starvation doesn't necessarily involve circular dependencies?it's often a result of unfair resource allocation policies.

Deadlock vs Starvation Comparison

Aspect Deadlock Starvation
Definition Multiple processes wait for each other in a circular chain, causing all to block permanently A process waits indefinitely while other high-priority processes continuously use the required resource
Process State All involved processes are blocked and make no progress High-priority processes execute while low-priority processes starve
Resource Usage Resources are held by blocked processes, creating circular dependencies Resources are actively utilized by high-priority processes
Conditions Required Mutual exclusion, hold and wait, no preemption, and circular wait Priority-based scheduling with unfair resource allocation
Prevention/Solution Avoid any of the four necessary conditions; use deadlock detection and recovery Use aging technique to gradually increase priority of waiting processes
Severity More severe?complete system halt for involved processes Less severe?system continues but some processes may never execute

Key Differences

  • Scope − Deadlock affects multiple processes simultaneously, while starvation typically affects individual processes.

  • Cause − Deadlock results from circular resource dependencies; starvation results from unfair scheduling policies.

  • Recovery − Deadlock requires breaking the circular wait or resource preemption; starvation is resolved by fair scheduling mechanisms.

Conclusion

Deadlock and starvation are both critical issues in operating systems that prevent processes from making progress. Deadlock creates a complete standstill among multiple processes due to circular resource dependencies, while starvation causes individual processes to wait indefinitely due to unfair resource allocation. Understanding these differences is essential for designing robust systems with proper prevention and recovery mechanisms.

Updated on: 2026-03-17T09:01:38+05:30

5K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements