in Operating System
1,726 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?

 

in Operating System
by
1.7k views

1 Answer

2 votes
2 votes
Best answer
  • 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

4 Comments

Yes avalable should be 111 in request p4
But still 2nd request is not satisfied .
We can not find need of p4 .
0
0

@ankitgupta.1729

as per me, question it self is invalid !

why ?

it is given that maximum demand of P4 is 7 0 4 and allocated is 0 0 4 ==> need 7 0 0.

So P4 can request with this constraint, but it requested 1 0 1 ==> how P4 can request C = 1 now, given that its maximum request is 4 and it allocated C=4.

1
1
yes. Question is wrong.
0
0