There will be more than one safe sequence (4 to be precise), try with banker's algorithm..

The Gateway to Computer Science Excellence

0 votes

D) more than 2 safe sequence.

First P3 shall complete and then other 3 processes in any order.

safe sequences:

(P3 P1 P2 P4), (P3 P1 P4 P2)

(P3 P2 P4 P1), (P3 P2 P1 P4)

(P3 P4 P2 P1), (P3 P4 P1, P2)

First P3 shall complete and then other 3 processes in any order.

safe sequences:

(P3 P1 P2 P4), (P3 P1 P4 P2)

(P3 P2 P4 P1), (P3 P2 P1 P4)

(P3 P4 P2 P1), (P3 P4 P1, P2)

0 votes

0 votes

(D)More than 2 safe sequences exist.

Explanation: After creating the Request and allocated table from the request allocated graph given above we can see R1, R2 and R3 are left with only 0,1 and 0 resources respectively. With this, we only can satisfy the need for P3. After P3 executes it releases 1 instance of R2 and one instance of R3 making the available resources of R1, R2, and R3 as 0,2 and 1 respectively. With this, we can satisfy the requirement of all the processes so we can schedule any one of them so there will be more than two safe sequences possible.

Explanation: After creating the Request and allocated table from the request allocated graph given above we can see R1, R2 and R3 are left with only 0,1 and 0 resources respectively. With this, we only can satisfy the need for P3. After P3 executes it releases 1 instance of R2 and one instance of R3 making the available resources of R1, R2, and R3 as 0,2 and 1 respectively. With this, we can satisfy the requirement of all the processes so we can schedule any one of them so there will be more than two safe sequences possible.

- All categories
- General Aptitude 1.9k
- Engineering Mathematics 7.5k
- Digital Logic 2.9k
- Programming and DS 4.9k
- Algorithms 4.3k
- Theory of Computation 6.2k
- Compiler Design 2.1k
- Databases 4.1k
- CO and Architecture 3.4k
- Computer Networks 4.1k
- Non GATE 1.5k
- Others 1.5k
- Admissions 595
- Exam Queries 576
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 17

50,645 questions

56,542 answers

195,693 comments

101,536 users