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


code Shared Memory and Semaphores (C and C++).
Go to the Dictionary of Algorithms and Data Structures home page.

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

Entry modified 30 June 2014.
HTML page formatted Wed Mar 13 12:42:45 2019.

Cite this as:
Paul E. Black, "dining philosophers", in Dictionary of Algorithms and Data Structures [online], Paul E. Black, ed. 30 June 2014. (accessed TODAY) Available from: