GATE / CS ARCHIVE

GATE CSE 1996 / QUESTION 2.19

Breaking circular wait at dinner

Operating Systems · Deadlocks · Full GATE CSE 1996 paper

GATE 1996, Q2.19 2 marks · MCQ
Report issue

Deadlocks

Question 2.19, GATE 1996: Which fork-taking rule prevents dining-philosopher deadlock: all left first, all right first, or one philosopher reversing the order used by everyone else?
Tap to enlarge
Your answer
Answer & solution

Answer: C: one reverses the order (no official key was published)

If every philosopher takes the same side first, all can hold one fork and wait for the next, forming a circular wait. Reversing one philosopher’s order breaks that directed cycle: the neighboring philosophers compete for a common first fork, so they cannot all simultaneously hold distinct first forks while each awaits the next. Consequently the full circular-wait deadlock is impossible in the standard ring model. This prevents deadlock, not necessarily starvation without a fairness assumption. The uniform-left and uniform-right rules both retain the circular wait.

Original paper, page 6