5,738 views
11 votes
11 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
13 votes
13 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
5 votes
5 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:

Related questions

6 votes
6 votes
1 answer
1
go_editor asked Jun 24, 2016
5,617 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...
7 votes
7 votes
4 answers
3
go_editor asked Jun 22, 2016
6,476 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...
5 votes
5 votes
5 answers
4
go_editor asked Jun 22, 2016
4,728 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...