• Networking
  • Programming
  • DBMS
  • Operating System
  • Internet
  • Hardware
  • Software

Tech Differences

Know the Technical Differences

Difference Between Deadlock and Starvation in OS

deadlock Vs starvationDeadlock and Starvation both are the conditions where the processes requesting for a resource has been delayed for a long. Although deadlock and starvation both are different from each other in many aspects. Deadlock is a condition where no process proceeds for execution, and each waits for resources that have been acquired by the other processes.

On the other hands, in Starvation, process with high priorities continuously uses the resources preventing low priority process to acquire the resources. Let us discuss some more differences between deadlock and starvation with the help of comparison chart shown below.

Content: Deadlock Vs Starvation

  1. Comparison Chart
  2. Definition
  3. Key Differences
  4. Conclusion

Comparison Chart

Basis for ComparsionDeadlockStarvation
BasicDeadlock is where no process proceeds, and get blocked.Starvation is where low priority processes get blocked, and high priority process proceeds.
Arising conditionThe occurrence of Mutual exclusion, Hold and wait, No preemption and Circular wait simultaneously.Enforcement of priorities, uncontrolled resource management.
Other nameCircular wait.Lifelock.
ResourcesIn deadlocked, requested resources are blocked by the other processes.In starvation, the requested resources are continuously used by high priority processes.
PreventionAvoiding mutual exclusion, hold and wait, and circular wait and allowing preemption. Aging.

Definition of Deadlock

Deadlock is a situation where the several processes in CPU compete for the finite number of resources available within the CPU. Here, each process holds a resource and wait to acquire a resource that is held by some other process. All the processes wait for resources in a circular fashion.

In the image below, you can see that Process P1 has acquired resource R2 that is requested by process P2 and Process P1 is requesting for resource R1 which is again held by R2. So process P1 and P2 form a deadlock.deadlockDeadlock is a common problem in multiprocessing operating systems, distributed systems, and also in parallel computing systems. There are four conditions which must occur simultaneously to raise the condition of deadlock, which are Mutual exclusion, Hold and waits, No preemption, and Circular wait.

  • Mutual exclusion: Only one process at a time can use a resource if other process requests the same resource, it has to wait till the process using resource releases it.
  • Hold and Wait: A process must be holding a resource and waiting to acquire another resource that is held by some other process.
  • No Preemption: The process holding the resources can not be preempted. The process holding the resource must release the resource voluntarily when it has completed its task.
  • Circular wait: The process must wait for resources in a circular fashion. Suppose we have three processes {P0, P1, P2}. The P0 must wait for the resource held by P1; P1 must wait to acquire the resource held by process P2, and P2 must wait to acquire the process held by P0.

Although there are some applications that can detect the programs that may get deadlocked. But the operating system is never responsible for preventing the deadlocks. It is the responsibility of programmers to design deadlock free programs. It can be done by avoiding the above conditions which are necessary for deadlock occurrence

Definition of Starvation

Starvation can be defined as when a process request for a resource and that resource has been continuously used by the other processes then the requesting process faces starvation. In starvation, a process ready to execute waits for CPU to allocate the resource. But the process has to wait indefinitely as the other processes continuously block the requested resources.

The problem of starvation generally occurs in priority scheduling algorithm. In priority scheduling algorithm, the process with higher priority is always allocated the resource, preventing the lower priority process from getting the requested resource.

Aging can resolve the problem of starvation. Aging gradually increases the priority of the process that has been waiting long for the resources. Aging prevents a process with low priority to wait indefinitely for a resource.

Key Differences Between Deadlock and Starvation in OS

  1. In a deadlock, none of the processes proceeds for execution, each process get blocked waiting for the resources acquired by the another process. On the other hand, starvation is a condition where the processes that possess higher priority is allowed to acquire the resources continuously by preventing the low priority processes to acquire resources resulting in indefinite blocking of low priority processes.
  2. Deadlock arises when four conditions  Mutual exclusion, Hold and wait, No preemption, and Circular wait occurs simultaneously. However, starvation occurs when process priorities have been enforced while allocating resources, or there is uncontrolled resource management in the system.
  3. Deadlock is often called by the name circular wait whereas, the starvation is called Lived lock.
  4. In Deadlock the resources are blocked by the process whereas, in starvation, the processes are continuously being used by the processes with high priorities.
  5. Deadlock can be prevented by the avoiding the conditions like mutual exclusion, Hold and wait, and circular wait and by allowing the preemption of the processes that are holding resources for a long time. On the other hand, Starvation can be prevented by aging.

Conclusion

Both Deadlock and Starvation delays the process execution by blocking it. On one hand where deadlock can cause processes to starve, and on the other hands starvation can get the processes out of the deadlock.

Related Differences:

  1. Difference Between Semaphore and Mutex
  2. Difference Between Semaphore and Monitor in OS
  3. Difference Between sleep() and wait() Method in Java
  4. Difference Between Linear Queue and Circular Queue
  5. Difference Between Stop-and-Wait Protocol and Sliding Window Protocol

Comments

  1. Rutuja says

    October 6, 2018 at 4:01 am

    Thank you so much for such great differences.

    Reply
  2. Rajesh Tanwar says

    February 2, 2019 at 12:55 pm

    Your posts are really awesome…you deserve great love and respect from me…Thank you so much

    Reply
  3. Robert Kealeboga says

    March 14, 2019 at 12:23 am

    Your Hard Work is Highly Appreciated…

    Reply
  4. Ahmed Shihab says

    October 7, 2019 at 2:32 pm

    Nice post…Appreciated.

    Reply
  5. data science course says

    April 7, 2023 at 12:30 pm

    Thank you for creating this helpful site.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Top 10 Differences

  • Difference Between OLTP and OLAP
  • Difference Between while and do-while Loop
  • Difference Between Guided and Unguided Media
  • Difference Between Preemptive and Non-Preemptive Scheduling in OS
  • Difference Between LAN, MAN and WAN
  • Difference Between if-else and switch
  • Difference Between dispose() and finalize() in C#
  • Difference Between for and while loop
  • Difference Between View and Materialized View
  • Difference Between Server-side Scripting and Client-side Scripting

Recent Addition

  • Difference Between Java and Python
  • Difference Between PHP and HTML
  • Difference Between GPS and GNSS 
  • Difference Between Virtualization and Containerization
  • Difference Between Storage and Memory

Categories

  • Artificial Intelligence
  • DBMS
  • Hardware
  • Internet
  • Networking
  • Operating System
  • Programming
  • Software

Copyright © 2025 · Tech Differences · Contact Us · About Us · Privacy