GATE | GATE-CS-2015 (Set 2) | Question 65
A system has 6 identical resources and N processes competing for them. Each process can request atmost 2 resources. Which one of the following values of N could lead to a deadlock?
(A)
1
(B)
2
(C)
3
(D)
4
Answer: (D)
Explanation:
For a deadlock to occur, the number of processes should exceed the number of available resources, leading to a situation where each process holds onto one resource and waits indefinitely for another resource to become available.
With 6 identical resources, each process can request at most 2 resources. Therefore, for deadlock to occur, the number of processes should be such that \(2 \times \text{number of processes} > 6).
Let’s check the options:
– (A) 1 process: (2 times 1 = 2) resources, which is less than 6. No deadlock.
– (B) 2 processes: (2 times 2 = 4) resources, still less than 6. No deadlock.
– (C) 3 processes: (2 times 3 = 6) resources, equal to the available resources. It could lead to deadlock if each process requests 2 resources and holds them, leaving none for the other processes to proceed.
– (D) 4 processes: (2 times 4 = 8) resources, exceeding the available resources. It could lead to deadlock as each process could hold onto 2 resources, leaving no resources for other processes to proceed.
So, the value of (N) that could lead to a deadlock is (D) 4.
Quiz of this Question
Please comment below if you find anything wrong in the above post
Last Updated :
28 Jun, 2021
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...