GATE - 2015 | OS | A system has 6 identical resources and N processes competing for them.

GATE - 2015 | OS | A system has 6 identical resources and N processes competing for them.
Posted on 10-02-2022

GATE - 2015 [Operating System]

Question:

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

1

B

2

C

3

D

6

   

Solution:

Option (D) is Correct.

Let's assume that each process request 2 resources each.

Now there is a total of 6 identical resources available.

Give 1 resource to every process then there will be deadlock because now each process will wait for another resource that is not available, so there will be deadlock.

Since there are a total of 6 resources so for the deadlock to be possible there should be 6 processes available.

Hence, the value of N is 6.

Thank You