Redirected
retagged by
6,949 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 
retagged by

4 Answers

Best answer
5 votes
5 votes

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
1 votes
1 votes

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

1 votes
1 votes

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

Answer:

Related questions

2 votes
2 votes
1 answer
1
makhdoom ghaya asked Jul 1, 2016
2,638 views
Which of the following is the correct value returned to the operating system upon the successful completion of a program ? 01-1Program do not return a value.
1 votes
1 votes
2 answers
2
makhdoom ghaya asked Jun 29, 2016
6,232 views
Match the following $:$$\begin{array}{clcl} \text{} & \textbf{List – I} && \textbf{List – II} \\ \text{a.} & \text{Contiguous allocation} & \text{i.} & \text{This s...
2 votes
2 votes
2 answers
3
makhdoom ghaya asked Jun 29, 2016
3,209 views
Match the following $:$$\begin{array}{clcl} & \textbf{List – I} && \textbf{List – II} \\ \text{a}. & \text{Multilevel feedback queue} & \text{i.} & \text{Time-slicin...
0 votes
0 votes
3 answers
4