Starvation: Difference between revisions
m (1 revision imported) |
pc>Yuron No edit summary |
||
| Line 3: | Line 3: | ||
([[Resources|Resource]]) starvation is often linked with [[Deadlock|deadlocks]] in that it can (potentially) cause progress to stop. However this is really more of a [[Process_Scheduling|scheduling]] issue. | ([[Resources|Resource]]) starvation is often linked with [[Deadlock|deadlocks]] in that it can (potentially) cause progress to stop. However this is really more of a [[Process_Scheduling|scheduling]] issue. | ||
A process is ‘starved’ if it can’t get some resource(s) | A process is ‘starved’ if it can’t get some resource(s) which it needs to proceed. This can be caused by other processes | ||
which it needs to proceed. This can be caused by other processes | |||
competing for (and winning) the resource. | competing for (and winning) the resource. | ||
<blockquote> | <blockquote> | ||
Example: A printer spooler picks the next job by queuing users | Example: A printer spooler picks the next job by queuing users alphabetically: Aaron is happy with the service but Zachary has a long wait at busy times. | ||
alphabetically: Aaron is happy with the service but Zachary has a | |||
long wait at busy times. | |||
This example is clearly fixable with a fairer scheduling algorithm, | This example is clearly fixable with a fairer scheduling algorithm, such as one based on a FIFO queue. | ||
such as one based on a FIFO queue. | |||
</blockquote> | </blockquote> | ||
One of the possible resources is processor time. In an <em>interactive</em> | One of the possible resources is processor time. In an <em>interactive</em> system it is important that the process scheduler is able to give <em>some</em> time even to low-[[Process Priority|priority]] tasks. (They may get a <em>smaller</em> share than the higher priority processes.) Effective priority may therefore be raised as a process ‘ages’. | ||
system it is important that the process scheduler is able to give | |||
<em>some</em> time even to low-[[ | |||
get a <em>smaller</em> share than the higher priority processes.) Effective | |||
priority may therefore be raised as a process ‘ages’. | |||
On the other hand, a <em>real-time</em> system should ‘finish’ | On the other hand, a <em>real-time</em> system should ‘finish’ all its pending jobs and go [[idle]] periodically, in which case | ||
all its pending jobs and go [[idle]] periodically, in which case | this should guarantee starvation cannot occur. (As long as the assumptions are really true.) | ||
this should guarantee starvation cannot occur. (As long as the | |||
assumptions are really true.) | |||
---- | ---- | ||
{{BookChapter|5.3.4|213}} | |||
{{PageGraph}} | {{PageGraph}} | ||
{{Category|IO}} | {{Category|IO}} | ||
{{Category|Deadlock}} | {{Category|Deadlock}} | ||
{{Category|Processes}} | {{Category|Processes}} | ||
Revision as of 13:43, 4 August 2019
| Depends on | Processes • Resources |
|---|
(Resource) starvation is often linked with deadlocks in that it can (potentially) cause progress to stop. However this is really more of a scheduling issue.
A process is ‘starved’ if it can’t get some resource(s) which it needs to proceed. This can be caused by other processes competing for (and winning) the resource.
Example: A printer spooler picks the next job by queuing users alphabetically: Aaron is happy with the service but Zachary has a long wait at busy times. This example is clearly fixable with a fairer scheduling algorithm, such as one based on a FIFO queue.
One of the possible resources is processor time. In an interactive system it is important that the process scheduler is able to give some time even to low-priority tasks. (They may get a smaller share than the higher priority processes.) Effective priority may therefore be raised as a process ‘ages’.
On the other hand, a real-time system should ‘finish’ all its pending jobs and go idle periodically, in which case this should guarantee starvation cannot occur. (As long as the assumptions are really true.)
| Also refer to: | Operating System Concepts, 10th Edition: Chapter 5.3.4, pages 213 |
|---|