Design and implement deadlock detection and prevention approach for a variable number of resources and processes on execution (C++ code).
Added by Timothy S.
Step 1
Deadlock Detection Approach: Show more…
Show all steps
Your feedback will help us improve your experience
Ct Turner and 65 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
When is it preferable to use the deadlock prevention scheme, the deadlock avoidance scheme, and the deadlock detection and recovery scheme? Can you provide scenarios where more than one of these schemes can be used?
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