@stblue plz see this ques.in this how option C that is 3 just after 2 is possible can u explain????

The Gateway to Computer Science Excellence

First time here? Checkout the FAQ!

x

+1 vote

Best answer

Looking at available resources, we only have 2 possible options i.e To satisfy the request of either P1 or P3. Lets consider both cases one by one ..

**Case ****1 :**** Initially request of P1 is satisfied....**

When P1 release all resources, available resources will become (5,3,2)

After P1 we have 2 option i.e we can satisfy the request of P3 or P4..

**Case 1.a**** :** If we satisfy the request of P3 first, After P3 completes its execution, available resources will becomes (7,4,3).. its enough to satisfy request of remaining **processes i.e P4, P2, P0 in any order**.

So number of possible safe sequence will be

P1 -> P3 -> ( P4, P2, P0 ) i.e 3 ! = **6 possible safe sequences**

**Case 1.b :** If after P1 if we decide to satisfy the request of P4, available resources after P4 completes its execution will be (5,3,4)..after P4 only possibility is P3, But as soon as P3 completes its execution we have enough resources we can satisfy the need of either **P0 or P2, in any order. **

So number of possible safe sequence will be

P1 -> P4 -> P3 -> ( P0 , P2) ie. 2! = **2 possible safe sequences**

**Case 2 : Initially request of P3 is satisfied.... **

Using similar logic you will get sequences as

P3 -> P1 -> (P4, P0, P2) i.e 3! = **6 possible safe sequences **

P3 -> P4 -> P1 -> (P2, P0) i.e 2! = **2 possible safe sequences **

So total number of safe sequences possible is 6+2+6+2 = 16

0

@stblue plz see this ques.in this how option C that is 3 just after 2 is possible can u explain????

- All categories
- General Aptitude 1.3k
- Engineering Mathematics 5.2k
- Digital Logic 2k
- Programming & DS 3.7k
- Algorithms 3.2k
- Theory of Computation 4k
- Compiler Design 1.6k
- Databases 3k
- CO & Architecture 2.6k
- Computer Networks 3k
- Non GATE 1k
- Others 1.3k
- Admissions 488
- Exam Queries 436
- Tier 1 Placement Questions 18
- Job Queries 56
- Projects 9

36,201 questions

43,661 answers

124,111 comments

42,944 users