A system has n resources R0, …, Rn−1 and k processes P0, …, Pk−1. The…

GATE · 2010 · CS · Computer Science & IT

A system has n resources R0, …, Rn−1 and k processes P0, …, Pk−1. The resource-request logic of each process Pi is:

if (i % 2 == 0) {
  if (i < n) request R_i
  if (i + 2 < n) request R_(i+2)
} else {
  if (i < n) request R_(n-i)
  if (i + 2 < n) request R_(n-i-2)
}

In which one of the following situations is a deadlock possible?

  1. A.

    n=40, k=26

  2. B.

    n=21, k=12

  3. C.

    n=20, k=10

  4. D.

    n=41, k=19

Attempted by 168 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…