What is Starvation?
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.
Example:
Process |
Burst Time |
Priority |
---|---|---|
P1 |
4 |
10 |
P2 |
7 |
1 |
P3 |
10 |
2 |
Gantt Chart
P1 |
P3 |
P2 |
|
---|---|---|---|
0 |
4 |
14 |
21 |
As we see in the above example process has higher priority than other processes getting CPU earlier. We can think of a scenario in which only one process has very low priority (for example 127) and we are giving another process with high priority, this can lead to indefinitely waiting for the process for CPU which has priority, which leads to Starvation. Further, we have also discussed the solution to starvation.
Starvation and Aging in Operating Systems
Starvation occurs when a process in the OS runs out of resources because other processes are using it. This is a problem with resource management while Operating systems employ aging as a scheduling approach to keep them from starving. 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.
Contact Us