||This article provides insufficient context for those unfamiliar with the subject. (August 2011)|
In priority-based scheduling algorithms, a major problem is indefinite block, or starvation. A process that is ready to run but waiting for the CPU can be considered blocked. A priority scheduling algorithm can leave some low-priority processes waiting indefinitely. A steady stream of higher-priority processes can prevent a low-priority process from ever getting the CPU.
Aging is used to ensure that jobs with lower priority will eventually complete their execution. This technique can be used to reduce starvation of low priority tasks. There are many ways to implement aging, but all have the same principle that the priority of a process should increase as it waits in the ready queue. The increase in priority may or may not be equal to the waiting time of the process.
Suppose a system with priority range of 0-512. In this system, 0 means highest priority. Consider a process with priority 127. If we increase its priority by 1 every 15 minutes, then in more than 32 hours the process will age to 0 priority and get executed.
- Silbershatz, Galvin, Gagne Operating System Principles, 7th ed., p.159
- Processor Scheduling - Notes - Operating Systems - Computer Science Now
|This operating system–related article is a stub. You can help Wikipedia by expanding it.|