Dining philosophers in action

When we learnt semaphores as part of our Operating Systems course during undergrad, one of the illustrations that was used was the “dining philosophers’ problem“.

The situation is simple – there are six philosophers seated around a table and six spoons placed between them. Each philosopher (the problem is not sensitive to the profession of the eater) has to now pick up a spoon. It is not clearly mentioned if a philosopher has to pick up the spoon on his left or on his right.

This is now a coordination problem. If all philosophers go the same way, all is good, since each of them gets exactly one spoon. If any two philosophers go the opposite ways, it results in two philosophers fighting over the same spoon while one spoon remains unclaimed. The use of semaphores in the solution to this problem is outside the scope of this blogpost.

Back when I learnt about the dining philosophers, it seemed like a rather esoteric and academic exercise (one minor point of hilarity occurred when this particular chauvinist in my hostel refused to read this book on operating systems by Silberschatz and Galvin because the book referred to philosophers as “she”. “How can philosophers be female, da?” reasoned this guy). It seemed unlikely that it would actually occur in real life.

Until it did tonight. The wife’s graduation ceremony was followed by cocktails and a formal sit down dinner. The dinner had been arranged around round tables, with large plates being set in front of each chair. Bread plates had been placed between the large plates.

So there were eleven of us around the table, with eleven plates in front of us, and eleven bread plates between us. The positioning of the bread plates meant that each of us could have either picked the plate on the left of us or the plate on the right (it was symmetrical to our seat). As the wines started to be brought in by bearers, it was time to consume the bread.

Our table consisted of eleven Indians, all of whom were unaware of the convention regarding bread plates. All of us wanted to eat bread, though. Had any of us known the convention, that person would’ve confidently swooped, and the rest of the table would have followed. With all of us being unaware, we stared at one another blankly, waiting for someone to move. A perfect Dining Philosophers Problem had been set up (dining MBAs and families, to be more precise).

We proved to be inefficient philosophers. Some moved left, others moved right. Those that saw people go left followed left. Those who saw people go right followed right. Inevitably there was a conflict, as my mother-in-law and I reached for the same bread plate.

The conflict was resolved by looking around the table to see the side that was in majority – most people had gone for the bread plates on their right. The rest made adjustments and bread was broken. It would turn out later that we were all wrong – the convention is for the bread plate to be placed to the eater’s left.

Ordinarily I might have been disturbed about my lack of knowledge of social conventions, and resulting faux pas. Seeing the Dining Philosophers’ Problem in action more than compensated for that today! Seeing my excitement at seeing the problem in action, the others on the table might have thought I’d had a glass of wine too many.

Put Comment