A solution to the Dining Philosophers Problem which avoids deadlock is

1996

A solution to the Dining Philosophers Problem which avoids deadlock is

  1. A.

    ensure that all philosophers pick up the left fork before the right fork

  2. B.

    ensure that all philosophers pick up the right fork before the left fork

  3. C.

    ensure that one particular philosopher picks up the left fork before the right fork, and that all other philosophers pick up the right fork before the left fork

  4. D.

    none of these

Attempted by 91 students.

Show answer & explanation

Correct answer: C

Deadlock arises from circular wait when all philosophers pick up the left fork first. Avoiding this requires breaking symmetry in resource acquisition order. Option 2 achieves this by altering the sequence for one philosopher, preventing the circular dependency.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir