Operating System Tutorial

Operating System Tutorial Types of Operating System Evolution of Operating System Functions of Operating System Operating System Properties Operating System Services Components of Operating System Needs of the Operating System

Operating Systems

Linux Operating System Unix Operating System Ubuntu Operating System Chrome Operating Systems Fedora Operating System MAC Operating System MS Windows Operating System Solaris Operating System Cooperative Operating System CorelDRAW Operating System CentOS FreeBSD Operating Systems Batch Operating System MS-DOS Operating System Commercial Mobile Operating Systems


Difference Between Multi-programming and Multitasking Difference between C-LOOK and C-SCAN Difference between Rotational Latency and Disk Assess Time Trap vs Interrupt Difference between C-SCAN and SSTF Difference between SCAN and FCFS Difference between Seek Time and Disk Access Time Difference between SSTF and LOOK Difference between Process and Program in the Operating System Difference between Protection and Security in Operating System

How To

How to implement Monitors using Semaphores How to Install a Different Operating System on a PC


What is Kernel and Types of Kernel What is DOS Operating System What is Thread and Types of Thread What is Process Scheduler and Process Queue What is Context Switching What is CPU Scheduling What is Producer-Consumer Problem What is Semaphore in Operating System Monitors in Operating System What is Deadlock What is Paging and Segmentation What is Demand Paging What is Virtual Memory What is a Long term Scheduler What is Page Replacement in Operating System What is BSR Mode What is Convoy Effect What is Job Sequencing in Operating System Why is it critical for the Scheduler to distinguish between I/O-bound and CPU-bound programs Why is there a Need for an Operating System


Process Management Process State Scheduling Algorithm FCFS (First-come-First-Serve) Scheduling SJF (Shortest Job First) Scheduling Round-Robin CPU Scheduling Priority Based Scheduling HRRN (Highest Response Ratio Next) Scheduling Process Synchronization Lock Variable Mechanism TSL Mechanism Turn Variable Mechanism Interested Variable Mechanism Deadlock Avoidance Strategies for Handling Deadlock Deadlock Prevention Deadlock Detection and Recovery Resource Allocation Graph Banker’s Algorithm in Operating System Fixed Partitioning and Dynamic Partitioning Partitioning Algorithms Disk Scheduling Algorithms FCFS and SSTF Disk Scheduling Algorithm SCAN and C-SCAN Disk Scheduling Algorithm Look and C-Look Disk Scheduling Algorithm File in Operating System File Access Methods in Operating System File Allocation Method Directory Structure in Operating System N-Step-SCAN Disk Scheduling Feedback Queue in Operating System Contiguous Memory Allocation in Operating System Real-time Operating System Starvation in Operating System Thrashing in Operating System 5 Goals of Operating System Advantages of Operating System Advantages of UNIX Operating System Bit Vector in Operating System Booting Process in Operating System Can a Computer Run Without the Operating System Dining Philosophers Problem in Operating System Free Space Management in Operating System Inter Process Communication in Operating System Swapping in Operating System Memory Management in Operating System Multiprogramming Operating System Multitasking Operating Systems Multi-user Operating Systems Non-Contiguous Memory Allocation in Operating System Page Table in Operating System Process Scheduling in Operating System Segmentation in Operating System Simple Structure in Operating System Single-User Operating System Two Phase Locking Protocol Advantages and Disadvantages of Operating System Arithmetic operations in binary number system Assemblers in the operating system Bakery Algorithm in Operating System Benefits of Ubuntu Operating System CPU Scheduling Criteria in Operating System Critical Section in Operating System Device Management in Operating System Linux Scheduler in Operating System Long Term Scheduler in Operating System Mutex in Operating System Operating System Failure Peterson's Solution in Operating System Privileged and Non-Privileged Instructions in Operating System Swapping in Operating System Types of Operating System Zombie and Orphan Process in Operating System 62-bit operating system Advantages and Disadvantages of Batch Operating System Boot Block and Bad Block in Operating System Contiguous and Non - Contiguous Memory Allocation in Operating System Control and Distribution Systems in Operations Management Control Program in Operating System Convergent Technologies in Operating System Convoy Effect in Operating System Copy Operating Systems to SSD Core Components of Operating System Core of UNIX Operating System Correct Value to return to the Operating System Corrupted Operating System Cos is Smart Card Operating System Cosmos Operating Systems Examples Generation of Operating System Hardware Solution in Operating System Process Control Block in Operating System Function of Kernel in Operating System Operating System Layers History of Debian Operating Systems Branches and Architecture of Debian Operating Systems Features and Packages of Debian Operating Systems Installation of Operating System on a New PC Organizational Structure and Development in Debian Operating Systems User Interface in Operating System Types Of Memory in OS Operating System in Nokia Multilevel Paging in OS Memory Mapping Techniques in OS Memory Layout of a Process in Operating System Hardware Protection in Operating System Functions of File Management in Operating System Core of Linux Operating System Cache Replacement Policy in Operating System Cache Line and Cache Size in Operating System What is Memory Mapping? Difference Between Network Operating System And Distributed Operating System What is the difference between a Hard link and a Soft Link? Principles of Preemptive Scheduling Process Scheduling Algorithms What is NOS? What is the Interrupt I/O Process? What is Time Sharing OS What is process termination? What is Time-Sharing Operating System What is Batch File File system manipulation What is Message-passing Technique in OS Logical Clock in Distributed System

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.