Five silent philosophers sit at a round table with bowls of food. Forks are placed between each pair of philosophers. All day the philosophers take turns eating and thinking. A philosopher must have two forks in order to eat, and each fork may only be used by one philosopher at a time. At any time a philosopher can pick up or set down the fork on their right or left, but cannot start eating until picking up both forks.
See source code in C++:
https://github.com/sergev/vak-opensource/blob/master/languages/c%2B%2B/philosophers/main.cpp