Below we present a few real life examples of potential deadlock and starvation. For each example, please select whether you think it is a case of deadlock, starvation, or neither.
In airport security there are two lines: one for TSA pre-check and one for all other passengers. TSA pre-check passengers go through security first. Every time a pre-check passenger is taken through security, another one arrives in the pre-check line. The other passengers wait and never get to go through security. This is an example of:
Correct! Since pre-check passengers are always given priority and there is always at least one pre-check passenger in line, regular passengers are never given the opportunity to move through the line.
Incorrect. Since pre-check passengers are always going through security, only one type of passenger is recieving service. An example of Deadlock in this case would be two unbelievably nice passengers, both a pre-check and regular. The pre-check sees a regular in line and offers for them to go first. Appreciative of the offer, the regular insists the pre-check go first, which the pre-check brushes off and again offers the regular go through security first. This back-and-forth exchange continues indefinitely.
Incorrect. Because there is a constant stream of pre-check passengers, and since pre-check passengers are given priority, regular passengers are unable to move through security.