recategorized by
11,520 views
4 votes
4 votes

A system has 4 processes and 5 allocatable resources. The current allocation and maximum needs are as follows:

  Allocated Maximum Available
Process A 1 0 2 1 1 1 1 2 1 3 0 0 x 1 1
Process B 2 0 1 1 0 2 2 2 1 0  
Process C 1 1 0 1 0 2 1 3 1 0  
Process D 1 1 1 1 0 1 1 2 2 1  

The smallest value of x for which the above system in safe state is

  1. 1
  2. 3
  3. 2
  4. 0
recategorized by

1 Answer

Best answer
5 votes
5 votes

here need matrix for all process is given below ( by (Max - allocated))

for     A    0  1  0  0  2           B    0  2  1  0  0      C    1  0  3  0  0     D     0  0  1  1  1 

available is  0  0  x  1  1  

so only D can execute for any no of x  as A,B or C need at least one instance  of either of first 2 resource

if x=1 then D can be executed  and will release its allocated resource which is 1 1 1 1 0   then available matrix

 will become   1  1  2  2  1 but with this neither of (A,B,C ) process can be executed as their need matrix is not less than or equal to available matrix so it will result in unsafe state.

if x=2  

then D can be executed  and will release its allocated resource which is 1 1 1 1 0   then available matrix

 will become   1  1  3  2  1   now Process C (with need 1 0 3 0  0 ) can be executed and release its allocated resources

(1 1 0 1  0 ) and then 

available matrix   will become  2   2  3  3  1  so B can be executed and then A (assuming some minor mistake in last resource)  hence it is safe state

so ans is C    x=2

Note :- process A can not be executed for any no of x  as its fifth resource need is 2 which can not be fulfilled

selected by
Answer:

Related questions

2 votes
2 votes
1 answer
1
go_editor asked Aug 8, 2016
2,795 views
In Unix, the login prompt can be changed by changing the contents of the file_____contrabinitgettydefsinittab
2 votes
2 votes
1 answer
2
go_editor asked Aug 8, 2016
4,851 views
Consider a disk with 16384 bytes per track having a rotation time of 16 msec and average seek time of 40 msec. What is the time in msec to read a block of 1024 bytes from...
6 votes
6 votes
1 answer
4
go_editor asked Aug 8, 2016
9,411 views
A virtual memory has a page size of $\textsf{1K}$ words. There are eight pages and four blocks. The associative memory page table contains the following entries :$\begin{...