Deadlock vs Starvation in Operating System OS: Difference and Comparison

The computer is considered one of the most successful inventions of mankind and has managed to serve us with hassle-free experiences while completing certain tasks. It has created a feasible space for us by helping us improve our work and social lives.

When we perform certain tasks on computers, there ought to happen some problems because of some technical issues. Two of such difficulties are 1. Deadlock, and 2. Starvation in Operating System OS.

Key Takeaways

  1. Deadlock occurs when two or more processes are waiting for each other to release resources, resulting in a deadlock situation, while starvation is when a process cannot obtain the resources needed for execution.
  2. Deadlock is a situation that occurs due to the improper synchronization of resources, while starvation occurs when a process is unable to acquire resources because other processes are holding them.
  3. Deadlock is a situation where no process can proceed further, while in starvation, some processes may be able to proceed, but the affected process will not.

Deadlock vs Starvation in Operating System OS

The difference between deadlock and starvation in an operating system os is the time when they occur. Deadlock occurs when processes hold a resource and waits for other process-held resources. On the other hand, starvation in the operating system os occurs when processes with low priority are blocked, and execution of high-priority processes takes place.

Deadlock vs Starvation in Operating System OS

The state in which a resource requested to perform a certain process is held by another waiting process is known as deadlock. Deadlock is witnessed in multiprocessing, distributed systems, and parallel computing.

In a deadlock, shared resources of the processes are adjudicated by hardware and software locks for the implementation of process synchronization. The reason for the occurrence of deadlock in communication systems is the loss or corruption of signals.

The occurrence of a problem when processes of low priority are blocked and the processes with high priority are carried out is known as starvation in the operating system os.

Starvation is a major problem in the priority scheduling algorithm as it causes uncertain waiting for the low priority procedures. Starvation also occurs in concurrent computing.

Some of the causes of starvation include errors in scheduling, resource leaks etc. An example of starvation is the third task in a multitasking system that switches between its first two tasks, is never carried out or is starved because of CPU time.

Also Read:  Crypto.Com vs Nexo: Difference and Comparison

Comparison Table

Parameters of ComparisonDeadlock in Operating System OSStarvation in Operating System OS
Meaning The state in which a resource requested to perform a certain process is held by another waiting process is known as deadlock.When processes of low priority are blocked and are not allowed, the resources and the processes with high priority are carried out by allowance of resources is known as starvation in the operating system os.
Also Known As Circular waitLived Lock
ResourcesResources are held by another waiting process. High priority processes use resources.
CausesThe simultaneous occurring of no preemption and circular wait, Mutual exclusion, hold and wait.Errors in scheduling, No control over resource management, Limitations in resources.
PreventionAllowance of preemption.Aging.

What is Deadlock in Operating System OS?

The state in which a resource requested to perform a certain process is held by another waiting process is known as deadlock. A deadlock is known as a Circular wait.

Both multiprocessing and distributed systems and also parallel computing witness deadlock situations. It is also observed in a communication system.

The occurrence of deadlock is because of reasons like Simultaneous occurrence of no preemption and circular wait, Mutual exclusion, hold and wait. If these four things occur simultaneously, a deadlock will occur.

The occurrence of deadlock in communication systems takes place because of the loss or corruption of signals.

The primary example of deadlock is, Process 1 is using Resource 2 of Process 2 and Process 2 is still carried out. Deadlock can be prevented by an allowance of preemption, using a resource allocation graph etc.

These resource allocation graphs can also be helpful in detecting a deadlock when a certain task or algorithm is executed.

Different operating systems handle the situation of deadlock differently. The approaches towards a deadlock situation include ignoring deadlock, detection, prevention etc.

There exist distributed deadlocks that occur in distributed systems because of distributed transactions or usage of concurrency control. Distributed deadlocks are avoided by drafting a global wait-for graph or by carrying out a distributing algorithm.

deadlock in operating system os

What is Starvation in Operating System OS?

The occurrence of a problem when processes of low priority are blocked and are not allowed the resources and the processes with high priority are carried out by allowance of resources, is known as starvation in the operating system OS.

The starvation in the operating system OS is also known as Lived Lock.

The reasons behind the occurrence of starvation in the operating system are Errors in scheduling, No control over resource management, and Limitations in resources.

Also Read:  PuTTY vs Cygwin: Difference and Comparison

The third task in a multitasking system that switches between its first two tasks is never carried out or is starved because CPU time is a prominent example of starvation.

The priority processes in the system that wait for a long time are gradually increased. This process is called Aging. The process of Aging is one of the measures of prevention or, rather is a solution for starvation in the operating system.

Generally, in a heavily loaded computer system, high-priority processes prevent the low-priority processes from ever getting the CPU.

Preventing starvation in the operating system can be prevented by other methods, such as avoiding processes that cause starvation, such as avoiding selecting random processes for resource allotment. The algorithm where starvation is not possible is called starvation-free or lockout-freed.

starvation in operating system os

Main Differences Between Deadlock and Starvation in Operating System OS

  1. A deadlock takes place whenever processes hold a resource and waits for other process-held resources on the other hand, starvation in the operating system occurs when processes with low priority are blocked, and execution of high-priority processes takes place.
  2. The prevention measures for deadlock include an allowance of preemption and avoidance of mutual exclusion on the other hand, starvation in the operating system can be avoided by the execution of the process of ageing.
  3. The condition of the resources is varied in both situations. In a deadlock, resources are held by other waiting processes and in starvation in the operating system, resources are utilized by high-priority processes.
  4. The rising condition of deadlocks includes an occurrence of four simultaneous cases on the other hand, starvation arises because of several reasons, including poor resource management.
  5. The rolling back of processes in both situations is different, in deadlock, both high and low-priority processes wait for each other, and none of the processes rolls back, which results in making the process an infinite one, on the other hand, in starvation, low priority processes rollback.
  6. Starvation in the operating system can be caused because of deadlock, but deadlock is not caused because of starvation.
References
  1. https://dl.acm.org/doi/abs/10.1145/800222.806755
  2. https://www.tandfonline.com/doi/abs/10.1080/03081078908935036

Last Updated : 16 June, 2023

dot 1
One request?

I’ve put so much effort writing this blog post to provide value to you. It’ll be very helpful for me, if you consider sharing it on social media or with your friends/family. SHARING IS ♥️

20 thoughts on “Deadlock vs Starvation in Operating System OS: Difference and Comparison”

  1. This article presents valuable information about deadlock, starvation, their causes, and prevention methods. Useful for anyone involved in systems management.

    Reply
  2. A thorough exploration of deadlock and starvation in the operating system OS. The article effectively elucidates the causes and prevention methods for these issues.

    Reply
  3. The description and comparison of deadlock and starvation in the operating system OS are very informative and insightful. This article is a valuable resource for understanding these issues.

    Reply
    • I share the same sentiment. It’s refreshing to find such well-articulated information on these technical aspects of system management.

      Reply
  4. I found the explanation of deadlock and starvation along with the detailed comparison between the two very insightful. It emphasizes the necessity of preemptive strategies in system management.

    Reply
    • The comparison table provides a clear and concise approach to understanding the differences between deadlock and starvation. A commendable presentation.

      Reply
  5. The detailed explanation of deadlock and starvation, complemented by the comparison table, offers a comprehensive understanding of these technical issues. An excellent resource for those involved in system management.

    Reply
    • I couldn’t agree more. It’s refreshing to find such well-articulated information about complex issues in system management.

      Reply
    • This article provides a structured understanding of deadlock and starvation in operating systems. The emphasis on prevention strategies is particularly noteworthy.

      Reply
  6. I found the section explaining deadlock in operating systems quite engaging. The article effectively breaks down the complex concepts for comprehensive understanding.

    Reply
  7. The invention of the computer has undoubtedly impacted humanity and has made a significant contribution to improving our efficiency and social lives. I appreciate the detailed information on deadlock and starvation in the operating system OS.

    Reply
    • I find it fascinating how computing systems work. Great insights into deadlock and starvation in the operating system OS.

      Reply
  8. The comparison between deadlock and starvation in the operating system OS is quite enlightening. Understanding the subtle differences between the two is essential for efficient system management.

    Reply
    • Absolutely. This article effectively highlights the necessity of preemptive measures in preventing deadlocks and the impact of unchecked resource allocation.

      Reply
  9. The distinction drawn between deadlock and starvation in the operating system OS is quite informative. The article provides a comprehensive overview of these technical issues.

    Reply
  10. The detailed insights into deadlock and starvation, along with the comparison table, provide a comprehensive understanding of the complexities involved in handling these issues. Essential knowledge for systems management.

    Reply
    • I completely agree. The article elaborates on the technical intricacies of deadlock and starvation in a detailed and understandable manner.

      Reply

Leave a Comment

Want to save this article for later? Click the heart in the bottom right corner to save to your own articles box!