3 ms·
This and subsequent pages disappointingly fail to explain the general solution to the deadlock problem. They present a specific instance of Dijkstra's general s
by unanswered 6y ago
This and subsequent pages disappointingly fail to explain the general solution to the deadlock problem. They present a specific instance of Dijkstra's general solution but I don't think they give a fully convincing explanation of why it works.
FWIW, Dijkstra's solution I'm thinking of is assigning a partial order to all mutexes and only acquiring multiple mutexes according to that order. For the specific problem of chopsticks, the easiest way to establish an order is to number them from 0 to 4 around the table; this will lead to the behavior of one philosopher (sitting between 0 and 4) picking left/right up in opposite order then the others.
- imtringued 6y agoThere is still the pathological case where everyone is waiting for one chopstick except the one person who is resolving the deadlock. You would end up with 2 people eating at the same time. When people are talking about 80 core server chips that's kind of letting you down.