13.07.2015 Views

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

144 Resource Deadlock Chapter 4by disgruntled users) and broken by injuring some process. Hierarchical allocation hasalso been used successfully, especially within the kernel to make sure that its modulesnever become deadlocked.11 FURTHER READINGA good mathematical treatment of deadlocks is given in Shaw’s textbook on operatingsystems (1974). The problem of deadlock avoidance was formalized and analyzedseveral years ago (Holt, 1972; Coffman et al., 1971; Hebalkar, 1970; Shoshani and Coffman,1970; Minoura, 1982). The advance-claim algorithm was first proposed by E.Dijkstra (1968). A generalization of the binary safe-unsafe criterion to a measure of theminimum number of resources needed for safety has been suggested by Madduri andFinkel (1984). Starvation has also been called ‘‘effective deadlock’’ by Holt (1971),who, along with others, has pointed out that partial allocation does not guarantee freedomfrom starvation (Parnas and Habermann, 1972; Rossi and Fontao, 1981).Starvation control has not been dealt with extensively. Holt suggested maintainingperiodically incremented counters for each blocked process (Holt, 1972). When acounter exceeds a critical value the scheduler has to find a safe sequence and finish jobsin that order. He also suggested partial allocations but required that resources not begranted to jobs with zero holdings. The approach of banning new jobs was introduced byMadduri and Finkel (1984). <strong>An</strong>other approach to starvation, which allocates resourcesaccording to a safe-sequence order, is found in the Boss 2 operating system for theRC4000 computer (Lauesen, 1973).12 EXERCISES1. The service calls for allocating and releasing resources look suspiciously like thecalls for allocating and releasing segments. Is there any fundamental differencebetween the two situations?2. The service call for allocation of resources cannot specify ‘‘either one resource ofclass 1 or one of class 2.’’ However, our dining philosophers might want to ask forwhichever chopstick is available first, then ask for the other one specifically.(a) Why aren’t all the chopsticks in the same resource class?(b) What could happen if we allow this sort of ‘‘selective resource allocation’’ anduse a liberal allocation policy?(c) How well would selective allocation mesh with the hierarchical allocation policy?(d) How well would selective allocation mesh with the advance-claim algorithm?

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!