How to Control Starvation?
- Resource distribution can be handled by an impartial manager. In an effort to prevent starvation, this resource manager allocates resources equitably.
- It is best to avoid choosing processes at random when allocating processors or resources because this promotes starvation.
- The principles of Ageing, where a process’s priority increases the longer it waits to prevent starvation, should be included in the resource allocation priority system.
Differences Between Deadlock and Starvation in OS
- 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.
- Another name for deadlock is Circular Waiting. Another name for starvation is Lived lock.
- 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
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.