Deadlock of resources - Operating System

Q.  A system has 'm' number of resources of same type and 3 processes A, B, C. Share these resources A, B, C which have the peak demand of 3, 4 and 6 respectively. Deadlock will not occur if the value of 'm' is __________.
- Published on 25 Aug 15

a. m = 15
b. m = 8
c. m = 13
d. m = 9

ANSWER: m = 13
 

    Discussion

  • Nirja Shah   -Posted on 23 Nov 15
    - Let us consider the peak demand situation of resources (A,B,C)=(3,4,6).

    - To conclude for a specific number of resources there is possibility of deadlock (not deadlock free), we need to find atleast one resource allocation which results in deadlock, which is an allocation that cannot completely satisfy the resource requirements of even one process.

    - Number of shared resources m = 7, the following resource allocation (for example)among 3 process A,B,C (2,3,2).

    - Process A holding 2 resources and waiting for 1, Process B holding 3 resource and waiting for 1 and process C holding 2 resources and waiting for 4 more resources.

    - This is a deadlock situation. With number of shared resources m = 9, the following resource allocation (for example)among 3 process A,B,C (2,3,4).

    - Process A holding 2 resources and waiting for 1, Process B holding 3 resource and waiting for 1 and process C holding 4 resources and waiting for 2 more resources.

    - This is a deadlock situation.

    - With number of shared resources m = 10, the following resource allocation (for example)among 3 process A,B,C (2,3,5). Process A holding 2 resources and waiting for 1, Process B holding 3 resource and waiting for 1 and process C holding 5 resources and waiting for 1 more resource.

    - This is a deadlock situation.

    - But for m >=11 , the resource allocation is deadlock free.

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)