Download the BYJU'S Exam Prep App for free GATE/ESE preparation videos & tests - Download the BYJU'S Exam Prep App for free GATE/ESE preparation videos & tests -

Difference Between Deadlock and Starvation in OS

Both of these are problems that occur during the execution of resources that prevent a fair execution. In this article, we will discuss the fundamental difference between deadlock and starvation in OS. But let us first know more about each of these in detail. Read ahead to know more.

What is Deadlock?

It occurs when every process has a resource and waits for the other resources that any other processes hold. Circular Wait, No Preemption, Hold and Wait, and Mutual Exclusion are the necessary conditions under which a deadlock occurs. In this case, any process that holds one resource and waits for another one doesn’t get executed.

What is Starvation?

It is a problem that happens when there occurs a continuous execution of all the high-priority processes and a continuous blockage for all the low-priority processes for an indefinite amount of time. A steady stream of various higher-priority processes in a heavily loaded system of computers can prevent all the low-priority processes from reaching the CPU ever. In the case of starvation, the high-priority processes continuously utilize all the resources. Aging can easily resolve the issue of starvation. Aging gradually increases the priority of all the long waiting processes.

Difference Between Deadlock and Starvation in OS

Here are the differences present between Deadlock and Starvation in OS:

Parameters Deadlock Starvation
Basics All of the processes that need to be executed keep waiting for each other. But there is no execution of any of these resources. There occurs a continuous execution of all the high-priority processes. And thus, all the low-priority processes get continuously blocked.
Resources All the processes block the resources. All the high-priority processes utilize the resources continuously.
Necessary Conditions The necessary conditions involve Circular Wait, No Preemption, Hold and Wait, Mutual Exclusion. It assigns priority to all the high-quality processes.
Alternative Name Deadlock is also called Circular wait. Starvation is also called lived lock.
Prevention We can prevent deadlock when we avoid any necessary conditions required for a deadlock. We can easily prevent starvation by aging.

Keep learning and stay tuned to get the latest updates on GATE Exam along with GATE Eligibility Criteria, GATE 2023, GATE Admit Card, GATE Application Form, GATE Syllabus, GATE Cut off, GATE Previous Year Question Paper, and more.

Comments

Leave a Comment

Your Mobile number and Email id will not be published.

*

*