Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a problem that is almost equal to the standard one of the dining philosophers, but has a quirk: while a philosopher thinks, he still holds the fork on his left.

If after the period of thinking (which isn't infinite), I release the fork on the left and then apply the normal solution (that is, acquire forks in the order of their priority), then would this solution be correct for this problem?

share|cite|improve this question

migrated from Sep 15 '12 at 13:42

This question came from our site for professional and enthusiast programmers.

When finished eating, are both forks released (so before thinking the left one has to be re-acquired)? or does the philosopher hold on to the left fork, only releasing the right one (so thinking starts immediately)? – subsub Sep 19 '12 at 8:33

If the philosopher eats (holding both forks), drops the right fork and thinks for a while, and then drops the left fork to take a nap (or something similar), it is just the original problem: Each philosopher must ensure getting both forks without deadlock. Take a look at Allen B. Downey's "The Little Book on Semaphores" for in-depth discussion (this problem is hard!).

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.