1,748 views
2 votes
2 votes

Banker algorithm is used by OS to avoid the deadlock. Following table shows the current allocation and maximum demand by process $P_{1}$,$P_{2}$,$P_{3}$ and $P_{4}$ for the instances $A,B,C$

    Process Max Demand (A,B,C) Current Allocation(A,B,C)
$P_{1}$              $8,2,3$              $3,1,0$
$P_{2}$              $4,8,5$              $3,8,4$
$P_{3}$              $9,7,1$              $9,6,0$
$P_{4}$              $7,0,4$              $0,0,4$

 

There are still $2,1,2$ instances of $A,B$ and $C$ are available respectively. Following processes made by process in the sequence.

Req1: $P_{1}$ requests $1,1,1$ of $A,B,C$ respectively

Req2: $P_{4}$ requests $1,0,1$ of $A,B,C$ respectively

Which of these two requests will be granted?

 

1 Answer

Best answer
2 votes
2 votes
  • If p1 is request then safe sequence is possible so, request of p1 is granted. But in case of p4 safe sequence is not possible so, request of p4 is not granted.

 

 

 

selected by

No related questions found