CS FundamentalsModerateGATE CS · Amazon/Microsoft SDE MCQ

Five philosophers each pick up their left fork and then their right fork. Which change removes the possibility of deadlock without adding a central arbiter?

  1. A. Make each philosopher release the left fork after eating
  2. B. Use a mutex around each fork
  3. C. Make one philosopher pick up the right fork first
  4. D. Make the forks counting semaphores initialised to 2

Correct answer: C. Make one philosopher pick up the right fork first

An asymmetric order breaks circular wait: the 'odd' philosopher competes for its right fork first, so all five cannot each hold one fork while waiting for the next. Mutexes per fork are what the deadlocking version already uses.

More Operating Systems questions

Exams that ask this topic