Starvation in OS

Learn via video courses
Topics Covered

Transform Your Career

Choose from our industry-leading programs designed for career success

NSDC Certified

Modern Software and AI Engineering Program

Master full-stack development with AI integration

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

Modern Data Science and ML with specialisation in AI

Advanced data science techniques with AI specialization

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

Advanced AIML with Specialisation in Agentic AI

Deep dive into AIML with focus on Agentic systems

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

DevOps, Cloud & AI Platform Engineering

Build and manage AI-powered cloud infrastructure

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

AI Engineering Advanced Certification by IIT-Roorkee

Premier AI engineering certification from IIT-Roorkee

3 MonthsDuration
AI-LedCurriculum
Career SupportSupport
Program highlights
Go to Program

Overview

Starvation is a problem of resource management where in the OS, the process does not have resources because it is being used by other processes. This problem occurs mainly in a priority-based scheduling algorithm in which the requests with high priority get processed first and the least priority process takes time to get processed.

What is Starvation in OS (Operating Systems)?

Starvation in OS

It is a problem when the low-priority process gets jammed for a long duration of time because of high-priority requests being executed. A stream of high-priority requests stops the low-priority process from obtaining the processor or resources. Starvation happens usually when the process is delayed for an infinite period of duration. Resources needed for the Operating system to handle requests of the process:

  • Memory
  • CPU time
  • Disk space
  • Bandwidth of network
  • I/O access to disk or network
Free Courses by top Scaler instructors
Python Course for Beginners With Certification: Mastering the Essentials
Java Course - Mastering the Fundamentals
DBMS Course - Master the Fundamentals and Advanced Concepts
JavaScript Course With Certification: Unlocking the Power of JavaScript
C++ Course: Learn the Essentials
Python and SQL for Data Science Course
Python Course for Beginners With Certification: Mastering the Essentials
Java Course - Mastering the Fundamentals
DBMS Course - Master the Fundamentals and Advanced Concepts
JavaScript Course With Certification: Unlocking the Power of JavaScript
C++ Course: Learn the Essentials
Python and SQL for Data Science Course

What Causes Starvation in OS

Here are a few reasons why starvation in OS occurs:

  • In starvation, a process with low priority might wait forever if the process with higher priority uses a processor constantly.
  • Because the low-priority processes are not interacting with resources the deadlock does not occur but there are chances of starvation as the low-priority processes are kept in a wait state.
  • Hence starvation is precisely a fail-safe method, that is it prevents deadlock temporarily but it affects the system in general.
  • The important cause of starvation might be that there are not enough resources to provide for every resource.
  • If a process selection is random then there can be a possibility that a process might have to wait for a long duration.
  • Starvation can also occur when a resource is never provided to a process for execution due to faulty allocation of resources.

Scaler Placement Report and Statistics

₹23L
AVG CTC
SCALER PLACEMENT PROOF

Scaler learners achieved 2.5x salary growth with average post-Scaler CTC reaching ₹23L.

11,000+placements
650+companies
Verified data
Hiring Partners:
GoogleGoogleAmazonAmazonMicrosoftMicrosoftFlipkartFlipkartAdobeAdobe1200+ more

Various Methods to Handle Starvation in OS

Here are the following ways in which the starvation situation in OS can be handled:

  • The allocation of resources by CPU should be taken care of by a freelance manager to ensure that there is an even distribution of resources.
  • Random choice of process method should be avoided due to which starvation occurs.
  • The aging criteria of processes should be taken into consideration while resource allocation to avoid starvation.
  • Scheduling algorithm with priority queue can also be used to handle starvation.
  • If the random technique is to be used then use it with a priority queue to handle starvation.
  • Multilevel feedback queue can also be used for avoiding starvation in the operating system.

Example of Starvation In Operating System

Starvation In Operating System

In the given example, the P2 process has the highest priority, and process P1 has the lowest priority. In the diagram, it can be seen that there is n number of processes ready for their execution. So in the CPU, the process with the highest priority will come in which is P2, and the process P1 will keep waiting for its turn because all other processes are at a high priority concerning that P1. This situation in which the process is waiting is called starvation.

Elevate your understanding of operating systems with the Scaler Topics free course. Enroll now and get a comprehensive overview of their structure and importance.

Turn Learning into Career Growth

1200+Hiring Partners
89%Placement Rate
11,000+Placements
147%Avg Salary Increment
2.5XCareer Growth
₹23 LPAAvg Post-Scaler Salary
1200+Hiring Partners
89%Placement Rate
11,000+Placements
147%Avg Salary Increment
2.5XCareer Growth
₹23 LPAAvg Post-Scaler Salary

Conclusion

  • Starvation is a problem of resource management where in the OS, the process does not have resources because it is being used by other processes.
  • It is a problem when the low-priority process gets jammed for a long duration of time because of high-priority requests being executed. A stream of high-priority requests stops the low-priority process from obtaining the processor or resources. Starvation happens usually when the method is delayed for an infinite period of duration.
  • Causes starvation in OS:
    • In starvation, a process with low priority might wait forever if the process with higher priority uses a processor constantly.
    • There are not enough resources to provide for every resource.
    • If a process selection is random then there can be a possibility that a process might have to wait for a long duration.
    • Resource is never provided to a process for execution due to faulty allocation of resources.
  • Various methods to Handle Starvation in OS
    • The allocation of resources by CPU should be taken care of by a freelance manager to ensure that there is an even distribution of resources.
    • Random choice of process method should be avoided.
    • The aging criteria of processes should be taken into consideration.
    • If a process selection is random then there can be a possibility that a process might have to wait for a long duration.
    • Starvation can also occur when a resource is never provided to a process for execution due to faulty allocation of resources.