8,251 views
13 13 votes

A total of 9 units of a resource type available, and given the safe state shown below, which of the following sequence will be a safe state?

Process Used Max
$P_1$ 2 7
$P_2$ 1 6
$P_3$ 2 5
$P_4$ 1 4
  1. $\langle P_4, P_1, P_3, P_2\rangle$
  2. $\langle P_4, P_2, P_1, P_3\rangle $
  3. $\langle P_4, P_2, P_3, P_1\rangle $
  4. $\langle P_3, P_1, P_2, P_4 \rangle$

2 Answers

Best answer
15 15 votes
Process Used Max Need
P1 2 7 5
P2 1 6 5
P3 2 5 3
P4 1 4 3

We have total 9 resources and out of 9, 6 are already allocated to the processes. Now we are left with 3 resource which can fulfill the need of process P3 and P4. Now if we check options A, B and C where first P4 is being served then after completion of P4 we will have total 3 + 1 = 4 resources but now we can't fulfill the need of either P1 or P2, because each needs 5 resource so option A, B and C can not be correct ans. Similarly we can check for option D where after P3 we can fulfill any combination. So Ans- D. <P3,P1,P2,P4><P3,P1,P2,P4><P3,P1,P2,P4>

selected by
6 6 votes

According to me answer should be

⟨P3,P1,P2,P4⟩

Available resourses A=3

By this we can only fulfill the future need of the P3

Now new availbility Anew=3+2=5,

By Anew we can fill the need of P1 or P2,Suppose we fill need of P1,then Anew=5+2=7

Anew=7,Now for P2;

Anew=7+1=8

Finally with P4;

Anew=8+1=9

So our system is safe and safe sequence is P3---->P1------->P2------>P4

Answer:
Position:
Show:

Related questions

9 9 votes
1 answers 1 answer
8.3k
8.3k views
go_editor asked Jun 24, 2016
8,308 views
In a system using single processor, a new process arrives at the rate of six processes per minute and each such process requires seven seconds of service time. What is th...
5 5 votes
2 answers 2 answers
3.4k
3.4k views
go_editor asked Jun 23, 2016
3,371 views
Belady's anomaly meansPage fault rate is constant even on increasing the number of allocated framesPage fault rate may increase on increasing the number of allocated fram...
12 12 votes
4 answers 4 answers
9.0k
9.0k views
go_editor asked Jun 22, 2016
9,026 views
Consider a 32-bit machine where four-level paging scheme is used. If the hit ratio to TLB is 98%, and it takes 20 nanosecond to search the TLB and 100 nanoseconds to acce...
6 6 votes
5 answers 5 answers
6.8k
6.8k views
go_editor asked Jun 22, 2016
6,784 views
A fast wide SCSI-II disk drive spins at 7200 RPM, has a sector size of 512 bytes, and holds 160 sectors per track. Estimate the sustained transfer rate of this drive57600...