A system has 6 identical resources and N processes competing for them. Each process can request at most 2 resources. Which one of the following values of N could lead to a deadlock?
A system has 6 identical resources and N processes competing for them. Each process can request at most 2 resources. Which one of the following values of N could lead to a deadlock? Correct Answer 6
Data:
Available identical Resources = R = 6
Max needs per process = 2
Concepts:
Deadlock can occur If any process gets available resource < needed (requested) resource
Max resource per process to be in deadlock = needed – 1 = 2 – 1 = 1
For N process, max resource to be in deadlock = N × 1 = N
Condition for deadlock
N ≥ R
N ≥ 6
values of N could lead to a deadlock is 6
Explanation:
As there are 6 identical resources and Max requirement is 2, hence Max. number of process can be allowed is
[ alt="ya07" src="//storage.googleapis.com/tb-img/production/17/03/ya07.JPG">
But when the number of process is more than 5
[ alt="ya08" src="//storage.googleapis.com/tb-img/production/17/03/ya08.JPG">
Important Point:
In GATE, option 4 is 4, which won't give the correct answer and hence option 4 has been changed to 6