Question: Suppose we use the Banker's Algorithm to avoid deadlock. Consider a system that has 5 processes P_1, P_2, P_3, P_4, P_5 and four types of

Suppose we use the Banker's Algorithm to avoid deadlock. Consider a system that has 5 processes P_1, P_2, P_3, P_4, P_5 and four types of resources a, b, c and d; it has 6 units of a, 3 units of b, 4 units of c, 2 units of d. The matrix EXISTING[] denotes the existing resource units and is always (6 3 4 2). AVAILABLE[] the units available for allocation; ALLOCATE[] denotes the units that have been allocated to the processes; NEED[] denotes the units that may still be needed by the processes to complete the tasks. Suppose at a certain state the matrices are as shown below. EXISTING = (6 3 4 2) ALLOCATED = (2 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0) P_1 P_2 P_3 P_4 P_5 NEED = (1 0 2 1 1 1 1 0 2 1 0 1 1 1 0 1 1 0 0 0) a) What is the AVAILABLE matrix? b) Is the system in a safe state? Why? c) If P_4 makes a request of (0 1 0 0), should the system grant the request? (If not, what should the system do?) You must show your steps clearly to prove that your answer is correct
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
