Reference no: EM132399112
Q (Request)R1 R2 R3
P1 1 0 0
P2 0 0 1
P3 0 0 0
A (Allocation)R1 R2 R3
P1 0 0 1
P2 1 0 0
P3 0 1 0
R (Total Resources)R1 R2 R3
2 1 1
Recall that the deadlock detection algorithm has the following pseudo-code (where m is the number of resources and n is the number of processes):
1. Mark each process that has a row in the Allocation matrix of all zeros.
2. Initialize a temporary vector W to equal the Available vector V.
3. Find an index i such that process i is currently unmarked and the ith row of Q is less than or equal to W. That is Qik ≤ Wk, for 1 ≤ k ≤ m. If no such row is found, terminate the algorithm.
4. If such a row is found, mark process i and add the corresponding row of the allocation matrix to W. That is, set Wk = Wk + Aik, for 1 ≤ k ≤ m. Return to step 3.
In this problem, you are to run the deadlock detection algorithm on the system state given in the previous problem. From your graph you should already be able to tell if the system has a deadlock or not (though one hint, there are 2 of R1 in the system, so be careful). We have not given you the available vector V, but you should be able to determine what the current available vector is (it is simply the total number of resources R minus those that have been allocated to processes, shown in A). Perform the deadlock detection algorithm by hand. Perform the steps (a) - (d) (looping back to c if/when needed). At the end, state your conclusion (deadlock or no deadlock), and why you reached your conclusion. Compare your conclusion to the information you should have gotten from the resource allocation graph in question 1.