Take the 2-minute tour ×
Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. It's 100% free, no registration required.

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|improve this question

migrated from stackoverflow.com 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

1 Answer 1

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|improve this answer

Your Answer

 
discard

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.