Saturday, November 24, 2007

IS215 - Resource Management Exercises - 2

11. Given a river crossing deadlock situation in Figure 6.3.

a) Name the three broad classes of policies dealing with deadlocks. Give one specific policy each to illustrate the classes using the river crossing 'deadlock situation.
b) Illustrate the Banker's algorithm using the river crossing deadlock situation.

12. The Banker's algorithm has some inherent weaknesses. Discuss some of these inherent weaknesses.

13. Deadlock avoidance is very expensive. Why?

14. Consider the traffic deadlock depicted in Figure 6.5.


Figure 6.5. Traffic deadlock

a) Show that the four necessary conditions for a deadlock indeed hold in the said situation.
b) Come up with a simple rule that will avoid deadlocks in the streets of Metro Manila.

15. Compare the four policies for dealing with deadlocks using the following criteria:

a) overhead introduced for adopting such policy,
b) inconvenience to users when a deadlock occurs,
c) difficulty of implementation.

16. Differentiate a deadlock situation from starvation.

17. Consider a computer system that has four magnetic tape drives (MT), four exchangeable disk drives (DD), two line printers (LP), and two card readers (CR). Suppose the current allocation of resources to processes are:

18. 19. P1 20. P2 21. P3 22. P4 23. Max
24. MT 25. 0 26. 0 27. 2 28. 2 29. 4
30. DD 31. 0 32. 0 33. 2 34. 2 35. 4
36. LP 37. 1 38. 0 39. 0 40. 0 41. 2
42. CR 43. 0 44. 1 45. 1 46. 0 47. 2

Suppose,

P1 is waiting for DD,
P2 is waiting for MT, and
P4 is waiting for CR.

Will a circular wait result if we allocate

LP to P2
LP to P3
LP to P4?

18. Why is deadlock recovery such a difficult policy to implement?

19.If the state is unsafe, it does not follow that the system will result to a deadlock. Explain why this is the case. Give an example of an unsafe state that will result to all the processes completing without deadlock occurring.

20. Under what circumstances would you adopt the following deadlock policies:
a) Bahala na
b) Avoidance
c) Detect and Recover
d) Prevention

No comments: