December2015 Cs Q29

0. A system has four processes and five 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 .............

  • Option : D
  • Explanation :
    If Process A’s Maximum need is 1 1 2 1 2 instead of 1 1 2 1 3, then answer will be x=1
    The needs matrix is as follows:
    0 1 0 0 1
    0 2 1 0 0
    1 0 3 0 0
    0 0 1 1 1
    If x is 0, available vector will be 0 0 0 1 1, we have a deadlock immediately.
    If x is 1, available vector will be 0 0 1 1 1, now, process D can run to completion. When it is finished, the available vector is 1 1 2 2 1.
    Now A can run to complete, the available vector then becomes 2 1 4 3 2.
    Then C can run and finish, return the available vector as 3 2 4 4 2.
    Then B can run to complete. Safe sequence D A C B.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *