in Operating System edited by
551 views
1 vote
1 vote
There are $5$ processes which require resource instances of same type in quantities $23, \ 35, \ 12, \ 43, \ 15$ respectively. The minimum number of resource instances required for preventing deadlock is _______
in Operating System edited by
by
551 views

1 comment

@bikram sir,

what's wrong in this 22+34+42+6+12=116

assign 1 less to all greater requirements and (15-12) +3 to second last and 12 to last one.
0
0

1 Answer

1 vote
1 vote
Best answer

Let here are n processes in the system and each one needs k instances of a resources to complete. Then the minimum number of resources that you should keep in the system to ensure no deadlock in the system is n*k-n+1 , where n*k = sum of all resources.

its like n*k-n resources are required so that each process can have one less than the resource instance they require.. but still deadlock can occur as each process depend upon other process for one resource instance ..if we provide n*k-n+1 resource instances than the deadlock condition will never occur.

so use this formula here , here n =5 , n*k = 23+35+12+43+15 =  128

so n*k-n+1 = 128-5+1= 123 +1= 124 

selected by

3 Comments

TELL FORUMLA
1
1
hi

bikram..

here u does not elaborate . how it is?
1
1

Yes @wanted 

Let here are n processes in the system and each one needs k instances of a resources to complete. Then the minimum number of resources that you should keep in the system to ensure no deadlock in the system is n*k-n+1 , 

because  there can be deadlock if none of the process have the required resources, i.e. if each have (k-1).meaning total n*(k-1).now even if there is 1 more resource, there canot be deadlock.so minimum requirement is n*(k-1)+1 = n*k-n+1 .

its like n*k-n resources are required so that each process can have one less than the resource instance they require.. but still deadlock can occur as each process depend upon other process for one resource instance ..if we provide n*k-n+1 resource instances than the deadlock condition will never occur.

so use this formula here , here n =5 , n*k = 23+35+12+43+15 =  128

so n*k-n+1 = 128-5+1= 123 +1= 124 

0
0
Answer:

Related questions