6
$\begingroup$

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?

$\endgroup$
1
  • $\begingroup$ 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)? $\endgroup$
    – subsub
    Commented Sep 19, 2012 at 8:33

1 Answer 1

1
$\begingroup$

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!).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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