NIST

dining philosophers

(classic problem)

Definition: Suppose a number of philosophers surround a dining table. Adjacent philosophers share one fork. They spend time thinking or trying to eat. A philosopher must have both the fork on the left and the fork on the right to eat. Clearly adjacent philosophers cannot eat at the same time. The problem is to find an algorithm for taking forks that prevents deadlock, starvation, etc.

Author: PEB

Implementation

code Shared Memory and Semaphores (C and C++), One example (Siefast) for the Siefast simulator.
Go to the Dictionary of Algorithms and Data Structures home page.

If you have suggestions, corrections, or comments, please get in touch with Paul E. Black.

Entry modified 10 January 2005.
HTML page formatted Tue Dec 6 16:16:32 2011.

Cite this as:
Paul E. Black, "dining philosophers", in Dictionary of Algorithms and Data Structures [online], Paul E. Black, ed., U.S. National Institute of Standards and Technology. 10 January 2005. (accessed TODAY) Available from: http://www.nist.gov/dads/HTML/diningphilos.html

to NIST home page