Let m[0]…m[4] be mutexes (binary semaphores) and P[0]…P[4] be processes.…

GATE · Computer Science · 2000

Let m[0]…m[4] be mutexes (binary semaphores) and P[0]…P[4] be processes. Suppose each process P[i] executes the following:

Assume every mutex is initially set to 1 (available).

wait(m[i]); wait(m[(i+1) mod 4]);

…

release(m[i]); release(m[(i+1) mod 4]);

This could cause:

  1. A.

    thrashing

  2. B.

    deadlock

  3. C.

    starvation, but no deadlock

  4. D.

    none of the above

Attempted by 322 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…