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.
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
Showing posts with label IS215 - Resource Management. Show all posts
Showing posts with label IS215 - Resource Management. Show all posts
Saturday, November 24, 2007
IS215 - Resource Management Exercises - 1
1. Discuss the two resource allocations methods (static and dynamic). Give the advantages of one over the other.
2. Classify the following resources as either sharable or non-sharable: CPU, memory, line printer, card reader, magnetic tape, magnetic disk, file, database record.
3. Give an example of a system in a deadlock situation. The example should be a system with at least three different types of resources.
4. Explain the four conditions for a deadlock to occur. Is it necessary for all four conditions to hold for a deadlock to occur.
5. Why does the Bahala Na policy work? Why is this policy not often used?
6. How can the circularity condition be prevented from holding? Illustrate how deadlock can be avoided by preventing this condition.
7. How can hold and wait be prevented from holding? Illustrate how deadlock can be avoided by preventing this condition.
8. One way of detecting a deadlock is to detect if circularity wait already holds in the system.
Outline a method of detecting a deadlock.
9. Outline the cheapest method of recovering from a deadlock. Support your answer by arguing for it.
10. Aborting a process during deadlock recovery is not that simple. Explain.
2. Classify the following resources as either sharable or non-sharable: CPU, memory, line printer, card reader, magnetic tape, magnetic disk, file, database record.
3. Give an example of a system in a deadlock situation. The example should be a system with at least three different types of resources.
4. Explain the four conditions for a deadlock to occur. Is it necessary for all four conditions to hold for a deadlock to occur.
5. Why does the Bahala Na policy work? Why is this policy not often used?
6. How can the circularity condition be prevented from holding? Illustrate how deadlock can be avoided by preventing this condition.
7. How can hold and wait be prevented from holding? Illustrate how deadlock can be avoided by preventing this condition.
8. One way of detecting a deadlock is to detect if circularity wait already holds in the system.
Outline a method of detecting a deadlock.
9. Outline the cheapest method of recovering from a deadlock. Support your answer by arguing for it.
10. Aborting a process during deadlock recovery is not that simple. Explain.
Subscribe to:
Posts (Atom)