Dining Philosophers Problem
(DPP) A problem introduced by Dijkstra concerning resource allocation between processes. The DPP is a model and universal method for testing and comparing theories on resource allocation. Dijkstra hoped to use it to help create a layered operating system, by creating a machine which could be consider to be an entirely deterministic automaton.
The DPP visualises this as a number of philosophers sitting round a dining table with a fork between each adjacent pair. Each philosopher may arbitrarily decide to use either the fork to his left or the one to his right but each fork may only be used by one philosopher at a time.
Several potential solutions have been considered.
Critical Regions - each processor is protected from interference while it exclusively uses a resource.
The best solution allows the maximum parallelism for any number of processes (philosophers), by using an array to track the process' current state (i.e. hungry, eating, thinking). This solution maintains an array of semaphores, so hungry philosophers trying to acquire resources can block if the needed forks are busy.