Open In App
Related Articles

Starvation and Aging in Operating Systems

Improve Article
Improve
Save Article
Save
Like Article
Like

We have already discussed priority scheduling in this post. It is one of the most common scheduling algorithms in batch systems. Each process is assigned a priority. The process with the highest priority is to be executed first and so on. Here we will be discussing a major problem related to priority scheduling and its solution.

Prerequisites: Priority Scheduling  

Starvation or indefinite blocking is a phenomenon associated with the Priority scheduling algorithms, in which a process ready for the CPU (resources) can wait to run indefinitely because of low priority. In a heavily loaded computer system, a steady stream of higher-priority processes can prevent a low-priority process from ever getting the CPU. There have been rumors that in 1967 Priority Scheduling was used in IBM 7094 at MIT, and they found a low-priority process that had not been submitted till 1973. 

prior

As we see in the above example process having higher priority than other processes getting CPU earlier. We can think of a scenario in which only one process is having very low-priority (for example 127) and we are giving other process with high-priority, this can lead indefinitely waiting for the process for CPU which is having low-priority, this leads to Starvation. Further we have also discuss about the solution of starvation. 

Differences between Deadlock and Starvation in OS are as follows: 

  1. Deadlock occurs when none of the processes in the set is able to move ahead due to occupancy of the required resources by some other process as shown in the figure below, on the other hand, Starvation occurs when a process waits for an indefinite period of time to get the resource it requires.
  2. Another name for deadlock is Circular Waiting. Another name for starvation is Lived lock.
  3. When deadlock occurs no process can make progress, while in starvation apart from the victim process other processes can progress or proceed.

Solution to Starvation: Aging

Aging is a technique of gradually increasing the priority of processes that wait in the system for a long time. For example, if priority range from 127(low) to 0(high), we could increase the priority of a waiting process by 1 Every 15 minutes. Eventually, even a process with an initial priority of 127 would take no more than 32 hours for the priority 127 process to age to a priority-0 process.

Limitations of the aging technique are listed below:

  • Increased complexity: Aging requires additional overhead to periodically adjust the priorities of waiting processes, which can increase the overall complexity of the scheduling algorithm.
  • Overhead: Frequent priority adjustments may introduce additional overhead, which can reduce the overall efficiency of the scheduling algorithm.
  • Unpredictable behavior: Aging can lead to unpredictable behavior if the aging rate is not set appropriately. If the aging rate is too slow, it may take a long time for low-priority processes to receive the required resources. On the other hand, if the aging rate is too fast, it can cause high-priority processes to starve.
  • Unfairness: Aging can also be unfair to newly arrived processes as it prioritizes long waiting processes over new ones. This can lead to a situation where new processes are starved of resources while long waiting processes continue to receive them.

If you like GeeksforGeeks and would like to contribute, you can also write an article using write.geeksforgeeks.org or mail your article to review-team@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks. 

Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

Level Up Your GATE Prep!
Embark on a transformative journey towards GATE success by choosing Data Science & AI as your second paper choice with our specialized course. If you find yourself lost in the vast landscape of the GATE syllabus, our program is the compass you need.

Last Updated : 23 Mar, 2023
Like Article
Save Article
Previous
Next
Similar Reads