Question discussion

In the dining-philosophers problem with five philosophers and five forks, which measure prevents deadlock?

1956Medium DSSSB TGT Computer Science 0 replies 1 views
0

In the dining-philosophers problem with five philosophers and five forks, which measure prevents deadlock?

  • AGiving each philosopher exactly one fork permanently
  • BMaking every philosopher pick up the left fork first
  • CAllowing at most four philosophers to sit at the table at the same time
  • DLetting every philosopher hold a fork until he finishes eating
Correct answer: C

Explanation

With at most four seated philosophers at least one can always get both forks, so a circular wait cannot form.

Discussion 0

Nobody has replied yet. Start the discussion!