Preview

Fahad

Powerful Essays
Open Document
Open Document
1135 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Fahad
CHAPTER 7
Deadlock is a problem that can arise only in a system with multiple active asynchronous processes. It is important that the students learn the three basic approaches to deadlock: prevention, avoidance, and detection (although the terms prevention and avoidance are easy to confuse).
It can be useful to pose a deadlock problem in human terms and ask why human systems never deadlock. Can the students transfer this understanding of human systems to computer systems?
Projects can involve simulation: create a list of jobs consisting of requests and releases of resources
(single type or multiple types). Ask the students to allocate the resources to prevent deadlock. This basically involves programming the Banker’s Algorithm.
The survey paper by Coffman, Elphick, and Shoshani [1971] is good supplemental reading, but you might also consider having the students go back to the papers by Havender [1968], Habermann [1969], and
Holt [1971a]. The last two were published in CACM and so should be readily available.

Exercises
7.1 Consider the traffic deadlock depicted in Figure 7.10.
a. Show that the four necessary conditions for deadlock indeed hold in this example.
b. State a simple rule for avoiding deadlocks in this system.
Answer:
a. The four necessary conditions for a deadlock are (1) mutual exclusion; (2) hold-and-wait; (3) no preemption; and (4) circular wait. The mutual exclusion condition holds since only one car can occupy a space in the roadway. Hold-and-wait occurs where a car holds onto its place in the roadway while it waits to advance in the roadway. A car cannot be removed (i.e. preempted) from its position in the roadway. Lastly, there is indeed a circular wait as each car is waiting for a subsequent car to advance. The circular wait condition is also easily observed from the graphic.
b. A simple rule that would avoid this traffic deadlock is that a car may not advance into an intersection if it is clear it will not be able

You May Also Find These Documents Helpful

Related Topics