×

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

Semaphore in Operating System

What is Semaphore in Operating System Semaphore is defined as an integer variable which is used to solve the problem of the critical section in process synchronization. In semaphore, we use...

3 minutes read.

HRRN Scheduling in OS

Highest Response Ratio Next (HRRN) Scheduling in OS Highest Response Ratio Next Scheduling is a Non-Preemptive Scheduling algorithm. This algorithm provides the benefits of the shortest job first scheduling algorithm and also removes...

6 minutes read.

SJF Scheduling in OS

Shortest Job First (SJF) Scheduling in OS Shortest Job First is a Preemptive or Non-Preemptive algorithm. In the shortest job first algorithm, the job having shortest or less burst time will...

4 minutes read.

Multi-user Operating Systems

Introduction Since only one user may interact with the computer at any given time, the operating system we use on our personal computers, laptops, tablets, and phones is sometimes referred to...

8 minutes read.

Difference between C-LOOK and C-SCAN Disk Scheduling Algorithm

Disk scheduling is used by operating systems to arrange the arrival of I/O requests to the disc. I/O scheduling is another name for disc scheduling. Disk scheduling is necessary because...

4 minutes read.

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.

Batch Operating System

Computers were once quite huge devices that operated from a console. Tape drives, punch cards, line printers were often utilized for the output, and tape drivers or card readers for...

4 minutes read.

FCFS Scheduling in OS

FCFS: First Come First Serve Scheduling in OS FCFS is a non-preemptive and preemptive scheduling algorithm that is easy to understand and use. In this, the process which reaches first is...

3 minutes read.

Inter Process Communication in Operating System

Inter-Process Communication or IPC refers to the methods and techniques that allow processes (programs or tasks) to communicate with each other within a computer system. This is typically done through...

3 minutes read.

Difference between Seek Time and Disk Access Time in Disk Scheduling

Seek Time The time taken for the hard disk controller to detect a specific piece of recorded data is known as the seek time. The amount of time it takes to...

4 minutes read.

Difference between Process and Program in the Operating System

What is a process in the Operating System? A process is a program that is going through the execution. It also helps us to execute all the lines of code in...

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.

Turn Variable or Strict Alternative Approach

Turn Variable or Strict Alternative Approach Turn Variable Approach is used for process synchronization mechanism, which offers synchronization between two processes. Turn variable is implemented on user mode, and it is a software mechanism. We...

3 minutes read.

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...

4 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.

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.

Fixed Partitioning in Operating System

Fixed Partitioning in OS Fixed Partitioning is also known as Contiguous memory allocation. Fixed Partitioning is the easiest method, which is used to load more than one process into the main memory. In Fixed...

5 minutes read.

Producer-Consumer Problem in OS

What is Producer-Consumer Problem? The Producer-Consumer problem is a classical problem. The Producer-Consumer problem is used for multi-process synchronization, which means synchronization between more than one processes. In this problem, we have one producer...

4 minutes read.

Components of Operating System

Components of Operating System: An operating system is a complex and vast system. We can only create the operating system by dividing it into small parts. Each part must be...

5 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.