×

Starvation in Operating System

Starvation is one of the major problems occurring when resource management is not done properly. This problem arises in the operating system when the resources are not being allocated for a long time to the processes which actually require them for execution. Processes that are of little importance or low preference are prohibited for an indefinite period of time to get the required resources.

In the situation of Starvation all the processes of higher precedence are always consuming all the available resources. A computer system that is fully loaded with various files, instructions, data, and processes contains a high chance that the processes of lower precedence are unable to reach the CPU (Central Processing Unit) of the system, hence leaving them without their execution. Starvation is called as a Lived lock.

Problem of Starvation

All the processes are lined up or queued to fulfil their optimum level of resources for their execution. And for the same purpose, processes are allotted with priority levels/numbers. Temporary jobs are given first scheduling or high priority. Zero (0) has the highest priority and the process with the largest number has the lowest priority.

Even if the process is available in the ready state for execution and has a lower level of priority, then it has to wait for a long period of time for execution. We all know that each and every problem comes along with its solution and the complicated Starvation also has a solution, which is termed as Aging.

Aging is basically a method or technique used to overcome the drawback of Starvation in any system. In Starvation each process is given some precedence or priority.  

For example: if a system has 0- 200 processes and Z is a process with 197 priorities (nearly the least priority process), it means that Z has to wait for an indefinite period of time, as the resources are only allocated to the processes with higher precedence. There is a low possibility that Z will be executed.

Starvation in Operating System

Solution of Starvation

There are a few practical solutions mentioned below, which can be used to prevent the situation of Starvation and enhance the resource management:

  • Aging: Aging is the required solution for Starvation. By using this aging method, we can moderately increase the priority of the processes that are waiting for a long time for their execution (increasing the priority level of the low process to slightly high and then to the processes of higher precedence).
    Example: Let's suppose our system has a priority level from 0 to 520, and 520    belongs to the lowest priority.

    Increase of process:
    Suppose the priority of a system varies from 0 to 127, where 0 has the highest priority, and 127 has the least priority. In the aging method, we can increment the precedence of a holding process by one each minute; surprisingly, if a process with the lowest priority would take a maximum of 32 hours to become the process of highest priority (0) from the lowest priority because of Aging.   

    Decrease of the process:   
    If the priority of a system varies from 0 to 127, where 0 has the highest priority, and 127 has the least priority. Let's suppose our system has a process named Z which has the lowest priority at zero minutes, and if we decrement the precedence number of the lowest precedence Z  by 1 in a time interval of 15 minutes. So, after passing 30 minutes, the precedence level of Z will be 125. After passing another thirty minutes, the precedence will rise to 123, and if this process continues, then the precedence of Z will rise near to the highest priority. It will get to the Central Processing Unit for the execution after a long-waited period of time.
  • Independent Manager: Allocation of resources can be done under the supervision of an independent resource manager. The manager will justly and adequately allocate the resources to all the processes and also try to avoid the situation of Starvation.
  • Random Selection: Random allocation of resources and unexpected ways of selecting processes (only priority-wise selection for execution) should be prohibited as they will surely result in Starvation.

Causes of Starvation

There are certain causes due to which the situation of Starvation arises in the Operating system

  1. Starvation also arises when a system lacks resources, leading to a decrease in the precedence of processes.
  2. There is a high chance that the lower precedence process has to wait for a non-ending span of time if processes with higher precedence are engrossing the resources, and since the lower processes are unable to interact with things required for execution, and it becomes really difficult for Starvation to source a deadlock. 
  3. This starvation technique is also considered as a fail-safe technique to escape the deadlock, and as a whole, it affects the system.
  4. If the system is using an unexpected way for selecting the processes, then there must be a process waiting for a long time because of not getting a selection.
  5. The problem of Starvation arises when there are insufficient resources provided for the processes.
  6. Starvation can also be caused if any resources are never allocated to processes that actually need them for execution.

Related Topics

Process Management in OS

A Program will not do anything unless a CPU executes its instructions. An executing program is called a process. The Process requires computer resources to complete its task. More than...

3 minutes read.

Scheduling Algorithms in OS

There are various types of scheduling algorithm which are used by the operating system to schedule the process on the processor. Objective of Scheduling Algorithms There are the following objectives of Scheduling Algorithms: Fare allocation...

2 minutes read.

Virtual Memory in Operating System

What is Virtual Memory Virtual Memory is a storage scheme in which the users have an illusion that users have a significant amount of Main Memory. We can perform this by taking a...

3 minutes read.

Android Operating System

What is Android Operating System? Android is a Linux-based and open-source operating system mainly established for mobile devices like tablet computers and Smartphones. The Android operating system was established by the...

5 minutes read.

Monitors in Operating System

Monitors in Operating System Monitors are used for process synchronization. With the help of programming languages, we can use a monitor to achieve mutual exclusion among the processes. Example of monitors:...

3 minutes read.

What is Deadlock in OS?

Deadlock in Operating System In an Operating System, a process uses various resources, and the resources are used in the following manner: Request the ResourceUse the ResourceRelease the Resource In the Operating System, Deadlock is a condition...

4 minutes read.

Distributed Shared Memory

Distributed Shared Memory is a process of managing memory over more than one node and makes inter-process communication which transfers to end users. It is a mechanism that allows user...

2 minutes read.

Simple Structure in Operating System

An operating system is a piece of software that lets the user applications talk to the hardware of the system. Because it is such a complicated structure, the operating system...

3 minutes read.

How to implement Monitors using Semaphores

Monitors Monitor is a type of synchronization device designed to solve difficulties caused by semaphores, such as timing errors. Monitors are the type of data types that are abstract by nature...

2 minutes read.

N-Step-SCAN Disk Scheduling

Before you study about N-Step-SCAN Disk Scheduling, it requires prerequisite of what is Disk Scheduling Algorithms: Operating systems use disc scheduling to schedule I/O requests that arrive at the disc....

4 minutes read.

Process Scheduling in Operating System

Process Scheduling is an essential component of a Multiprogramming Operating System. So now let’s understand how it works by taking a real-life example. Suppose that you want to call someone...

6 minutes read.

Types of Operating System

There are various types of operating system: Simple Batch Operating SystemMultiprogramming batch Operating SystemTime-sharing Operating SystemMultiprocessor Operating SystemDistributed Operating SystemNetwork Operating SystemReal-time Operating SystemMobile Operating System Simple Batch operating system In the simple batch operating system, there is no direct communication between...

6 minutes read.

CPU Scheduling in OS

What is Scheduling? Scheduling is the process that is used to share the computing resources such as memory, processor time, and bandwidth to the different processes, data flows, threads, and applications that need...

5 minutes read.

Advantages of Operating System

What is an Operating System?   An operating system is an interface that helps to communicate with the user and the computer hardware. Operating systems are used for file management, memory...

3 minutes read.

MS-DOS Operating System

It is also referred to occasionally as "DOS", an abbreviation for disc operating systems. Operating systems with a graphical user interface (GUI) in different iterations of the graphical Microsoft Windows...

5 minutes read.

File Access Methods in Operating System

File Access Methods in OS There are various types of file access methods in the operating system: Sequential Access MethodDirect Access MethodIndex Sequential Access Method Sequential Access Method: - Sequential Access Method is...

3 minutes read.

Operating System Services

The Operating System provides various types of services:   I/O operationProgram executionFile system manipulationCommunicationError HandlingResource allocationAccountingProtection 1. I/O Operation: - To execute a program, needs I/O, which consists of a file, or I/O device. Due to the protection...

3 minutes read.

Advantages of UNIX Operating System

What is UNIX OS? UNIX is a family of multitasking, multiuser operating systems that are used on a wide variety of computer platforms. It was developed in the late 1960s and...

4 minutes read.

Deadlock Prevention in Operating System

Deadlock Prevention The conditions which we used for deadlock prevention are: Mutual ExclusionHold and WaitNo PreemptionCircular Wait 1. Mutual Exclusion: - From the resource point of view, the mutual exclusion means that simultaneously more...

4 minutes read.

Kernel in OS

What is Kernel in OS? The kernel is the core component in the operating system. The job of the kernel is to handle the communication between the hardware and the software. ...

2 minutes read.