GATEverse
← GATE CSE 1988

Q11

NATMarks unknown

A number of processes could be in a deadlock state if none of them can execute due to non-availability of sufficient resources. Let Pi,0≤i≤4P_i, 0 \leq i \leq 4 represent five processes and let there be four resources types rj,0≤j≤3r_j, 0 \leq j \leq 3. Suppose the following data structures have been used. Available: A vector of length 44 such that if Available [i]=k[i]=k, there are k instances of resource type rjr_j available in the system. Allocation. A 5×45 \times 4 matrix defining the number of each type currently allocated to each process. If Allocation [i,j]=k[i,j]=k then process pip_i is currently allocated kk instances of resource type rjr_j. Max. A 5×45 \times 4 matrix indicating the maximum resource need of each process. If Max[i,j]=kMax[i,j]=k then process pip_i, may need a maximum of kk instances of resource type rjr_j in order to complete the task. Assume that system allocated resources only when it does not lead into an unsafe state such that resource requirements in future never cause a deadlock state. Now consider the following snapshot of the system.

r0r1r2r3p00012p11000p21354p30632p40014Allocationr0r1r2r300121750235606520656Maxr0r1r2r31520Available\overset{\Large{\text{Allocation}}}{\begin{array}{|l|lll|} \hline & r_{0} & r_{1} & r_{2} & r_{3} \\\hline p_{0} & 0 & 0 & 1 & 2 \\ p_{1} & 1 & 0 & 0 & 0 \\ p_{2} & 1 & 3 & 5 & 4 \\ p_{3} & 0 & 6 & 3 & 2 \\ p_{4} & 0 & 0 & 1 & 4 \\\hline \end{array}}\quad \qquad \overset{\Large{\text{Max}}}{\begin{array}{|llll|} \hline r_{0} & r_{1} & r_{2} & r_{3} \\\hline 0 & 0 & 1 & 2 \\ 1 & 7 & 5 & 0 \\ 2 & 3 & 5 & 6 \\ 0 & 6 & 5 & 2 \\ 0 & 6 & 5 & 6 \\\hline \end{array}} \qquad \quad \overset{\Large{\text{Available}}}{\begin{array}{|llll|} \hline r_{0} & r_{1} & r_{2} & r_{3} \\\hline 1 & 5 & 2 & 0 \\\hline \end{array}}

Is the system currently in a safe state? If yes, explain why.

Sign in to save attempts.

Loading…