a concise shot of dev knowledge
Become a Contributor
Concise shots of dev knowledge

RELATED TAGS

general
community creator

What is the starvation problem?

Anjana Shankar

When a process is waiting for a resource that is repeatedly given to some other process, it is known as starvation.

Let’s say the operating system uses a very simple implementation of Priority Queue for resource allocation, but a higher priority process keeps a lower priority process from ever getting the resource. This means that the low priority process is starved.

Deadlock

A deadlock is when a process is waiting on a resource that is held by a second process. The second process is in turn waiting for a resource that is held by the first process. In this scenario, neither of the processes are able to move forward.

For example, Process 1 has acquired Resource 1. Now, Process 1 is waiting on Resource 2. Additionally, Resource 2 has been acquired by Process 2; so, Process 2 is waiting for Resource 1. In effect, neither Process 1 nor Process 2 can make any progress. This is called as deadlock.

Starvation

As previously stated, starvation is when a process keeps waiting for a resource that is being given to other processes. This is shown below:

Solution to starvation

A low priority task’s priority is bumped up based on how much time it has been in the queue. This is known as Aging and ensures that even the lowest priority processes are eventually bumped up to the highest priority.

RELATED TAGS

general
community creator
RELATED COURSES

View all Courses

Keep Exploring

Learn in-demand tech skills in half the time

Copyright ©2022 Educative, Inc. All rights reserved.

soc2