Understanding starvation
Starvation is a problem in concurrent systems, in which a process (or a thread) cannot gain access to the necessary resources in order to proceed with its execution and, therefore, cannot make any progress. In this section, we will look into the characteristics of a starvation situation, analyze its most common causes, and finally, consider a sample program that exemplifies starvation.
What is starvation?
It is quite common for a concurrent program to implement some sort of ordering between the different processes in its execution. For example, consider a program that has three separate processes, as follows:
- One is responsible for handling extremely pressing instructions that need to be run as soon as the necessary resources become available.
- Another process is responsible for other important executions, which are not as essential as the tasks in the first process.
- The last one handles miscellaneous, very infrequent tasks.
Furthermore...