Sunday, October 26, 2008

The Dining Philosophers

Once upon a time there were four philosophers. Their real names had long ago been forgotten, but they called each other Adam, Blake, Carl, and Dudley. Dudley was the most outspoken of the group, and he one day invited Adam, Blake and Carl to dine with him.

The philosophers, being philosophers, did not have much in the way of worldly possesions, but Dudley did own a small square table, four chairs, four plates, two knives, and two forks. Due to their indigent circumstances the philosophers did not mind sharing utensils with each other, but because they were rather eccentric they would absolutely refuse to eat without both a knife and a fork in their hand.

Dudley arranged the table with one plate on each side, and between the plates he placed a fork or a knife, carefully ensuring that each philosopher would have a fork on one side and a knife on the other. When his guests arrived he saw them to their seats and served the meal. The philosophers out of habit, all reached for the silverware on their right. After they grabbed the untensil there, they then tried to grab the one on their left, only to find it was gone. They were all hungry, and each refused to let go of the utensil he had.

This situation continued long into the night, and in fact continued until Blake, exhausted, collapsed. Adam grabbed the knife he had, proceeded to eat, and then left his silverware which allowed both Carl and Dudley to dine. Poor Blake had to wait until he was revived.

The story of the dining philosophers is an old one in the lore of computer science because it demonstrates the dangers of reaching deadlock in an uncoordinated society. If citizens pursue their own interests without regard to society's interests there is a chance that they will find themselves holding on to a fork (or a knife) and refusing to give it up until their neighbors release the knife (or fork). This situation is clearly not desirable.

We promise a solution to the dining philosophers' problems. The solution has two phases:
  1. Help society coordinate its actions so that we can all benefit
  2. Buy more forks and more knives

Rest assured that we are working hard on these goals, and that with your support we will achieve them. At the GNU Public Dictatorship we are nothing if not dedicated to you!

No comments: