Starvation - aryanjoshi0823/5143-Operating-System GitHub Wiki

Starvation: Problems arise when high-priority requests lead low-priority processes to become stalled indefinitely. The low-priority process cannot access the processor or other resources because of a constant stream of high-priority demands. Starvation typically occurs when a task is postponed indefinitely.


What Leads to OS Starvation?

The following are common causes of starvation in an operating system:

  • If a higher priority operation uses a CPU continuously, a low priority process may wait indefinitely in starvation.
  • Deadlock does not happen because low-priority processes do not interact with resources, but because they are stuck in a waiting state, there is a risk of starving.
  • Thus, hunger is a fail-safe strategy, as it prevents deadlock temporarily but has an overall negative impact on the system.
  • The main contributor to starving may be the fact that not enough resources are available to meet all needs.
  • There is a chance that a process may have to wait for a long time if a process selection is random.
  • Starvation can also happen when an improper resource allocation prevents a process from ever receiving a resource for use.

Various Approaches to Tackle OS Starvation

The following methods can be employed to address starvation in operating systems:

  • Ensure equitable resource allocation.
  • Avoid random process selection methods.
  • Implement process ageing.
  • Use priority or multilevel feedback queues.