Deadlock vs. Starvation in OS

The difference between deadlock and starvation in OS is that in deadlock condition no process proceed and get blocked whereas in starvation low priority process got blocked and process with high priority get proceeded.

Advertisement - Continue Reading Below
Deadlock vs. Starvation in OS

The operating system is one of the most important concepts in computer science. If you want to master in computer science, you need to learn about the operating system.  In the operating system, two important concepts are deadlock and starvation. In the operating system, only one process can execute at a time, so there are conditions like deadlock and starvation to make the whole operating system.  In every aspect deadlock and starvation are different. In deadlock condition, no process proceed and get blocked whereas in starvation low priority process got blocked and process with high priority get proceeded.

Deadlock is the condition where all the resources are busy with the process, and a new process has to face deadlock and wait. There is a circular fashion in which resources are given to the processes. If P1 that processes one has acquired resource 2 and has requested by process p1, then there is a deadlock. In multiprocessing operating system deadlock is the most common problem. If one process has required a process that is requested by another process, then there is a condition of deadlock. In multiprocessing operating system, deadlock is the common problem. There must be four conditions to make deadlock that is mutual exclusion, hold and waits, no preemption and circular wait.

Advertisement - Continue Reading Below

In Starvation low priority process got blocked and process with high priority get proceeded. There are priorities in the operating system, the process with high priority is given a resource and process with low priority is given resource after the resource is given to high priority process. When the process is ready to execute, the process waits for CPU to allocate the resource.  For solving the problem of starvation, ageing is made.  Ageing increases the priority of the process.

Contents: Difference between Deadlock and Starvation in OS

Comparison Chart

Basis Deadlock Starvation
Meaning In deadlock condition, no process proceed and get blocked.

In starvation low priority process got blocked and process with high priority get proceeded.

Advertisement - Continue Reading Below

 

Another name Another name of deadlock is a circular wait Another name of starvation is LifeLock
Resource and process In a deadlock, if request ion resource is busy with the process, there is a deadlock In starvation, high priority process is given the resource.
Prevention Avoiding mutual exclusion, hold and wait, and circular wait and allowing preemption in deadlock In starvation ageing is prevention.

 Deadlock

Deadlock is the condition where all the resources are busy with the process, and a new process has to face deadlock and wait. There is a circular fashion in which resources are given to the processes. If P1 that is process one has acquired resource 2 and has requested by process p1, then there is a deadlock.

In multiprocessing operating system deadlock is the most common problem. If one process has required a process that is requested by another process then there is a condition of deadlock. In multiprocessing operating system, deadlock is the common problem. There must be four conditions to make deadlock that are mutual exclusion, hold and waits, no preemption and circular wait.

Starvation

In Starvation low priority process got blocked and process with high priority get proceeded. There are priorities in the operating system, the process with high priority is given a resource and process with low priority is given resource after the resource is given to high priority process. When the process is ready to execute, process waits for CPU to allocate the resource.  For solving the problem of starvation, ageing is made.  Aging increases the priority of the process.

Key Differences

  1. In deadlock condition no process proceed and get blocked whereas In starvation low priority process got blocked and process with high priority get proceeded.
  2. Another name of deadlock is circular wait whereas other name of starvation is LifeLock.
  3. In a deadlock, if request ion resource is busy for the process, there is a deadlock whereas in starvation high priority process is given the resource.
  4. Avoiding mutual exclusion, hold and wait, and circular wait and allowing preemption in deadlock whereas in starvation ageing is prevention.
Advertisement - Continue Reading Below

Conclusion

In this article above we see the clear difference between deadlock and starvation with proper example.

Explanatory Video

Advertisement - Continue Reading Below

Leave a Comment