Open In App
Related Articles

GATE | GATE CS 2018 | Question 30

Improve Article
Save Article
Like Article

Consider a system with 3 processes that share 4 instances of the same resource type. Each process can request a maximum of K instances. Resource instances can be requested and released only one at a time. The largest value of K that will always avoid deadlock is _______ .

Note – This was Numerical Type question.

(A) 1
(B) 2
(C) 3
(D) 4

Answer: (B)


Number of processes (P) = 3
Number of resources (R) = 4

Since deadlock-free condition is:

R ≥ P(N − 1) + 1

Where R is total number of resources,
P is the number of processes, and
N is the max need for each resource.

4 ≥ 3(N − 1) + 1
3 ≥ 3(N − 1)
1 ≥ (N − 1)
N ≤ 2

Therefore, the largest value of K that will always avoid deadlock is 2.
Option (B) is correct.

Quiz of this Question

Level Up Your GATE Prep!
Embark on a transformative journey towards GATE success by choosing Data Science & AI as your second paper choice with our specialized course. If you find yourself lost in the vast landscape of the GATE syllabus, our program is the compass you need.

Last Updated : 25 Feb, 2018
Like Article
Save Article
Similar Reads