5. Consider the resource allocation diagram: P1 P2 P3 R1 R2 a. Is this situation deadlocked? Why or why not? b. Is this situation "safe" according to Bankers' algorithm (is there a way for all processes to complete)? Why or why not? c. Does safety in the bankers' algorithm eliminate all possible kinds of deadlock? Why or why not? d. Does lack of safety in the bankers' algorithm guarantee deadlock? Why or why not?
Added by Josefa P.
Close
Step 1
- P1 is holding R1. - P2 is holding R2. - P3 is requesting R1 and R2. Show more…
Show all steps
Your feedback will help us improve your experience
Shreya Jain and 67 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Akash M.
12. In one of the deadlock prevention methods, impose a total ordering of all resource types, and require that each process requests resources in an increasing order of enumeration. This violates the _______________ condition of deadlock. a. Mutual exclusion b. Hold and Wait c. Circular Wait d. No Preemption
Joy D.
Concurrency Control. a) A park rents rowboats online. Part of the online rental process requires each renter to reserve two oars, the number of life jackets that the renter will need, and a boat before placing the reservation. Write a single pseudo-code algorithm that enables people to run their own software clients to rent and return boats. Use the two-phase locking protocol and make sure to avoid deadlocks! Explain why your algorithm avoids deadlocks. Assume that the locking command is lock(resource, number) where resource is the item that the customer wishes to lock and number is the amount of items to be locked. Assume the results of a call to the lock command are either SUCCESS or FAIL. Assume that the unlocking command is unlock(resource, number), the command to reserve a boat is reserveBoat(), and the command to ride a boat is rideBoat(). b) Write a pseudo-code algorithm for both the lock(resource, number) and unlock(resource, number) methods.
Supreeta N.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Watch the video solution with this free unlock.
EMAIL
PASSWORD