in Operating System
1,194 views
6 votes
6 votes
Consider a system having 'm' resources of the same type. These resources are shared by 3 processes A, B and C, which have peak time demands of 3, 4 and 6. The minimum value of 'm' that ensures that deadlock will never occur given that the combined maximum resource requirement of processes B and C at any time is 8 will be ______.
in Operating System
by
1.2k views

2 Answers

13 votes
13 votes
Best answer
Answer is - 9

B and C at any time require maximum 8 resources. So, for deadlock to happen, only 6 resources must be allocated to B and C together. (If 7 is allocated either B or C can continue execution). Since A has peak demand of 3, in worst case for deadlock, it must be allocated 2 resources. So, maximum no. of resources that can be allocated during deadlock is 6 + 2 = 8. With 1 extra resource deadlock won't happen and hence answer is 9.
selected by

4 Comments

I don't know where this question is originated but it seem incorrect, it's like guessing rather than conceptual
0
0
It is not guessing, but more aptitude than technical.
0
0

@Arjun sir

kindly check this

B and c combined need

(1,7) or (2,6) or (3,5),(4,4)-----we have to allocate  6 resources to both in a combined manner for deadlock

Is this reasoning valid

1
1
0 votes
0 votes
Answer must be 8

1 comment

in case of 8

imagine A is given 2, B is given 3 and C is given 3 WHERE A needed 3, B needed 4 and C needed 4 (how?)

A demands 2 resources and goes to sleep. B demands 3 and sleeps. C demands 3 and sleeps. Now anyone could wake and find 0 resources available.

it'll be a deadlock

there are only 3 combinations, BC can demand i.e. B-C demands 3-5 or 4-4 or 2-6 (because sum should be 8). In case of 9, suppose A takes away 2, 7 remaining. This 7 can be easily distributed among those 3 combinations while satisfying the need of any 1 completely.
0
0
Answer:

Related questions