Difference between Deadlock and Starvation in OS

Last Updated :

Deadlock 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.

1. Deadlock :
Deadlock is a situation where a set of processes are blocked because each process is holding a resource and waiting for another resource acquired by some other process.

It is important to mention that the situation of deadlock occurs if these four conditions hold true all simultaneously –

  1. Mutual Exclusion: One or more than one resource are non-sharable (Only one process can use at a time)
  2. Hold and Wait: A process is holding at least one resource and waiting for resources.
  3. No Preemption: A resource cannot be taken from a process unless the process releases the resource.
  4. Circular Wait: A set of processes are waiting for each other in circular form.

For example, in the below diagram, Process 1 is holding Resource 1 and waiting for resource 2 which is acquired by process 2, and process 2 is waiting for resource 1. Hence both process 1 and process 2 are in deadlock.

2. Starvation :
Starvation is the problem that occurs when high priority processes keep executing and low priority processes get blocked for indefinite time. In starvation resources are continuously utilized by high priority processes. Problem of starvation can be resolved using Aging. In Aging priority of long waiting processes is gradually increased.

Difference between Deadlock and Starvation :


S.No. Deadlock Starvation
1. All processes keep waiting for each other to complete and none get executed. High priority processes keep executing and low priority processes are blocked.
2. Resources are blocked by the processes. Resources are continuously utilized by high priority processes.
3. No process can make progress Apart from the victim process other processes can progress or proceed
4. Requires external intervention to end this sitution. May or may not require external intervention.
5. It can be prevented by avoiding the necessary conditions for deadlock It can be prevented by Aging

Note :

  1. Deadlock arises when four conditions Mutual exclusion, Hold and wait, No preemption, and Circular wait occurs simultaneously.
  2. Deadlock is often called by the name circular wait whereas, the starvation is called Lived lock.
  3. Deadlock can be prevented by the avoiding at least one condition : Mutual Exclusion, Hold and Wait, No Preemption, and Circular Wait.
  4. Starvation can be prevented by aging.
  5. Other name of deadlock is Circular Waiting. Other name of starvation is Lived lock.



Please write comments if you find anything incorrect. A gentle request to share this topic on your social media profile.

Comment
Next Article
CPP_Programmer Published 23 Sep, 2020 · 3 min read

Similar Reads

  • Software concepts of Computer

    Before starting the software concepts, let us take a brief look into the components of computer. Components of Computer: A computer system has 3 components namely: Hardware, Software,…

    3 min read
  • Difference between Full Virtualization and Para-virtualization

    Process of abstracting underlying hardware components from software is the primary concept behind virtualization. 1. Full Virtualization In full virtualization, a single host operating system allows the execution…

    2 min read
  • Difference between COM and DCOM

    COM :- COM stands for Component Object Model.The COM is a software architecture that allows application to be built from binary software component. It is introduced in 1993…

    2 min read
  • Storage Structure memory

    Storage structure consists of registers, main memory, and magnetic disk is only one of many possible storage systems. There are also cache CD ROM, magnetic takes, and so…

    3 min read
  • Difference between Firewall and Proxy Server

    Both firewall and thee proxy are resided between the local system and the internet to provide security against the network threats. 1. Firewall: A firewall is an application…

    2 min read
  • What is Software and its Types ?

    Software is nothing but a program or collection of programs that perform a specific task. Software is a bridge between user and computer hardware. Softwares directs the peripheral…

    1 min read