edited by
12,356 views
2 votes
2 votes

Consider a system with twelve magnetic tape drives and three processes $P_1, P_2$ and $P_3$. process $P_1$ requires maximum ten tape drives, process $P_2$ may need as many as four tape drives and $P_3$ may need upto nine tape drives. Suppose that at time $t_1$, process $P_1$ is holding five tape drives, process $P_2$ is holding two tape drives and process $P_3$ is holding three tape drives, At time $t_1$, system is in:

  1. safe state
  2. unsafe state
  3. deadlocked state
  4. starvation state
edited by

3 Answers

Best answer
4 votes
4 votes

System is in UNSAFE state

  • P1  holds  5 tapes
  • P2 holds 2  tapes
  • P3 holds 3  tapes


Total 10 tapes are allocated and 12-10=2 tapes are free

  • P1 requires maximum 10 tape drives; It needs 10-5 =5 more tapes
  • P2 may need as many  as 4tape drives. It needs 4-2=2 more tapes.
  • P3 may need as many as 9 tape drives. It needs 9-3=6 more tapes.

 
We can allocate 2 free tapes to P2.

P2 will complete execution and release all its resources including 4 tapes.

Even if we allocate 4 tapes to P1 or P3 they cannot complete execution because P1 nees 5 more taps while P3 needs 6 more tapes.

System is in unsafe state.!!!

selected by
3 votes
3 votes


At time T1
Maximum need P1  P2  P3
10 4 9
Allocated P1  P2  P3
5 2 3
Total tape drives = 12
Available tape drives = 12-(Allocated tape drives)
= 12 - (10)=2
Need  P1  P2  P3
5 2 6
So process P2 needs 2 tap drives and we have available 2.
So P2 satisfies is need at t1 After this Available becomes 4
So we can see neither P1 nor P3 need satisfies so system no longer becomes 
safe and System goes to unsafe state at time t1

0 votes
0 votes

System is unsafe .

Explanation

Processes Used Max Need
P1 5 10 5
P2 2 4 2
P3 3 9 6

Now Available A=12-(5+3+2)=2

Anew=2,With Anew we can only fulfil the desire of P2

Now Anew=2+2=4

Anew=4::: With Anew=4 we are totaly unable to fulfill the need of P1 and P3.So there is no sequence exist by which we can say system in safe.

Answer:

Related questions

2 votes
2 votes
2 answers
1
go_editor asked Aug 11, 2016
2,214 views
What will be the output of the following Unix command?$\text{\$ rm chap0[1-3]}$Remove file $\text{chap0[1-3]}$Remove file $\text{chap01, chap02, chap03}$Remove file $\tex...
2 votes
2 votes
1 answer
2
go_editor asked Aug 11, 2016
3,453 views
In Unix, the command to enable execution permission for file "mylife" by all is_____Chmod ugo $+$ X mylifeChmod a $+$ X mylifeChmod $+$ X mylifeAll of the above
2 votes
2 votes
1 answer
3
go_editor asked Aug 11, 2016
1,588 views
The character set used in Windows $2000$ operating system is$8$ bit ASCIIExtended ASCII$16$ bit UNICODE$12$ bit UNICODE
0 votes
0 votes
1 answer
4
shekhar chauhan asked Jun 5, 2016
3,941 views
Match the following in Unix file system :$\begin{array}{clcl} & \textbf{List-I} & & \textbf{List-II} \\ \text{(a)} & \text{Boot block} & \text{(i)} & \text{Information a...