A scheduling algorithm that can avoid deadlocks is known as the banker\'s algori
ID: 3724163 • Letter: A
Question
A scheduling algorithm that can avoid deadlocks is known as the banker's algorithm. This algorithm can be generalized to handle multiple resources. Below are two matrices. The matrix on the left shows how many of each resource are currently assigned to each of five processes. The matrix on the right shows how many resources each process still needs in order to complete The three vectors at the right of the figure show the existing resources, E, the possessed resources, P, and the available resources, A, respectively A| 1 | 1 | 0 | 0 | E= (6342) P (5322) 0 | 1 | 1 | 2 | A = (1020) Resources assigned Resources still needed Show how each process could be scheduled so that deadlock can be avoided. Show the new values of possessed (P) and available (A) before and after each process is granted a request.Explanation / Answer
With A = (1020), we can assign one scanner to D. Now P = (5332) and A=(1010)
When process D finishes, A = (2121) and P =(4221)
Now, we can satisfy requests of process A as well as process E but one at a time. Let assign the process to A.
Now A = (1021) and P=(5321). When process A finishes, A = (5132) and P = (1210).
Now let's assign resources to C, we will have A = (2032) and P = (4310). When C finishes, we will have A = (6243) and P = (0010)
Now let's assign resources to B, we will have A =(6131) and P = (0212). When B finishes, we will have A=(6342).
Now, we assign the resources to E and when E is finished we will have A=(6342)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.