multithreadingconcurrencydining-philosopher

Dining Philosophers problem - A Clarification needed


Recently I read this Wikipedia article regarding the Dining Philosophers problem but I am not clear with Chandy / Misra solution.

According to the article, "When a philosopher with a fork receives a request message, he keeps the fork if it is clean, but gives it up when it is dirty." In the context of this question, he passes it if he is eating and keeps it if he has not started eating yet.

According to the scenario, What is the meaning of Dirty? Thread is running or it has yeilded?


Solution

  • Dirty means that processing has started so it can be interrupted.

    And you can only process if you have two forks.