Question: Case study: An operating system uses the Bankers algorithm for deadlock avoidance when managing the allocation of four resource types A, B, C and D
Case study:
An operating system uses the Bankers algorithm for deadlock avoidance when managing the allocation of four resource types A, B, C and D to five processes P1, P2, P3, P4 and P5. Resource type A has 7 instances, B has 4 instances, type C has 3 instances and type D has 2 instances. The table given below presents the current system state. Here, the Allocation matrix shows the current number of resources of each type allocated to each process and the Max matrix shows the maximum number of resources of each type required by each process during its execution.

Answer the following questions considering the above case study:
1. What will be the content of the Need matrix?
2. Apply the Safety algorithm on the given case study and provide the results.
3. Consider the following independent requests for additional resources in the current state:
|
Discuss the safe state of the system in case of serving REQ1 and REQ2, independently.
4. Draw the resource- allocation graph for the given system by analyzing the above table.
5. Develop a program to avoid the deadlock in the given system using Bankers Algorithm
Processes Max Allocation Available A B D P1 N 1 0 1 A B C D A B C D 0 1 0 1 1 0 0 1 1 0 1 0 P2 1 1 1 0 P3 4 1 1 1 3 3 0 1 1 P4 0 N 0 2 0 1 0 0 P5 4 2 1 0 N 2 1 1 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
