in Operating System retagged by
6,759 views
3 votes
3 votes

Consider a system with five processes $P_{0}$ through $P_{4}$ and three resource types $R_{1}$, $R_{2}$ and $R_{3}$ . Resource type $R_{1}$ has $10$ instances, $R_{2}$ has $5$ instances and $R_{3}$ has $7$ instances. Suppose that at time $T_{0}$, the following snapshot of the system has been taken :

          Allocation

         $R_{1}$         $R_{2}$          $R_{3}$

$P_{0}$     0            1             0

$P_{1}$     2            0             0

$P_{2}$     3            0             2

$P_{3}$     2            1             1

$P_{4}$     0            2             2

            Max

$R_{1}$         $R_{2}$           $R_{3}$ 

7            5              3

3            2              2

9            0              2

2            2              2

4            3              3

           Available

$R_{1}$         $R_{2}$            $R_{3}$

3             3               2

Assume that now the process $P_{1}$ requests one additional instance of type $R_{1}$ and two instances of resource type $R_{3}$. The state resulting after this allocation will be 

  1. Ready state 
  2. Safe state 
  3. Blocked state
  4. Unsafe state 
in Operating System retagged by
6.8k views

2 Comments

reshown by
Kindly tag the source of this question. Also, here is a source that is worth the re-tagging.

UGC-NET 2014 - June - Paper II - Qn 33
0
0
done
0
0

4 Answers

5 votes
5 votes
Best answer

Answer is B).

By taking one instance of R1 , P1 will fulfill its need of maximum R1

and By taking two instances of R3 , P1 will fulfill its need of maximum R3

Now , it needs two instances of R2 after which it can complete execution  and release all of its resources,

hence it is in safe state .

selected by
by

1 comment

wrong question
0
0
1 vote
1 vote

option (b)

process no alocation (R1 R2 R3) max  need(R1 R2 R3)  reaminig need (R1 R2 R3) available(R1 R2 R3)
 p0 010 753 743 332
p1 200 424 224  
p2 302 902 600  
 P3 211 222 011  
P4 022 433 411  

initially need for process is 322 but process P1 requests one additional instance of type R1 and two instances of resource type R3. with 332 we can satisfy p3 need therefore giving all its allocated resource back resulting 5 4 3 now available resources. with 5 4 3 we can satisfy either p1 need or  p4 need here we cant satisfy p0 or p2 need becauz remaining need resouce are more than available resource  so on ..... therefore there is safe state with safe sequence as P3, P4, P1 , P2. P0

4 Comments

okk thx..
0
0
This answer is wrong. This question is taken from Galvin book theory section. Please validate.
0
0

with 5 4 3 we can satisfy either p1 need or  p4 need here

 

This answer is completely wrong, You cannot satisfy p1(i.e. 7 4 3) with 5 4 3.  Since 7 4 3 > 5 4 3

0
0
1 vote
1 vote

Need=Max-Allocation

Need

           R1        R2           R3

 P0      7            4              3

 P1       1            2              2

 P2       6            0              0

 P3       0            1              1

 P4       4            1              1

If Available<=Need

then Available[Pi]=Available[Pi]+Need[Pi]

Safe state is P1->P3->P4->P0->P2

0 votes
0 votes

Ans (B) Safe State

Reference link

Answer:

Related questions