Copyright © Philip M. Parker, INSEAD. Terms of Use.

| Domain | Definition |
Computing | Dining Philosophers Problem |
Source: compiled by the editor from various references; see credits. | |
(From Wikipedia, the free Encyclopedia)
In 1965, Edsger Dijkstra used the example of a group of philosophers to solve a synchronization problem. Five philosophers are sat around a circular table and each has a plate of spaghetti in front of him with a fork either side (i.e. five philosophers, five plates, and five forks). Suppose that the life of a philosopher consists of periods of eating and thinking, that each philosopher needs two forks to eat, and that forks are picked up one at a time. After successfully picking up two forks, a philosopher eats for a while and then puts down the forks and thinks. The problem consists in developing an algorithm to avoid starvation and deadlock. Deadlock might occur if each of the five philosophers has one fork and no one can get a second fork. The philosopher a waits for the fork grabbed by philosopher b who is waiting for the fork of philosopher c and so forth, making a circular chain of deadlock. Starvation might also happen independently of deadlock if a philosopher is unable to acquire both forks.
The solution consists of having the philosophers report their state as hungry, thinking, and eating. A philosopher cannot eat unless he has declared his state as hungry and both of his neighboring philosophers are not eating. The status of the philosophers is kept using a shared data struture (e.g an array). A philosopher may enter the eating state only if both of its neighbors are not in that state. To ensure this, the philosopher obtains a mutex lock and then changes his state from thinking to hungry. After he changes his state, he tries to obtain both forks and will not do so until both of his neighbors have left the eating state. At which point the philosopher, changes his state to eating and releases the lock. The philosopher then eats. After the philosopher is done eating, he again obtains a mutex lock, changes his state to thinking and sees, one at a time, if any of its two neighbors is hungry. If at least one is hungry, that philosopher enters the eating state and the cycle continues.
The lack of available forks is an analogy to the locking of scarce resources in real computer programming, a situation known as concurrency. Locking a resource is a common technique to ensure the resource is accessed by only one program or chunk of code at a time. When the resource the program is interested in is already locked by another one, the program waits until it is unlocked. When several resources are involved in locking resources, deadlock might happen, depending on the circumstances. For example, one program needs two files to process. When two such programs lock one file each, both programs wait for the other one to unlock the other file, which never happens.
Source: adapted by the editor from Wikipedia, the free encyclopedia under a copyleft GNU Free Documentation License (GFDL) from the article "Dining philosophers problem."
Crosswords: DINING PHILOSOPHERS PROBLEM |
| Specialty definitions using "DINING PHILOSOPHERS PROBLEM": DPP. (references) |
Hexadecimal (or equivalents, 770AD-1900s) (references)44 49 4E 49 4E 47      50 48 49 4C 4F 53 4F 50 48 45 52 53      50 52 4F 42 4C 45 4D |
| Leonardo da Vinci (1452-1519; backwards) (references)
|
Binary Code (1918-1938, probably earlier) (references)01000100 01001001 01001110 01001001 01001110 01000111 00100000 01010000 01001000 01001001 01001100 01001111 01010011 01001111 01010000 01001000 01000101 01010010 01010011 00100000 01010000 01010010 01001111 01000010 01001100 01000101 01001101 |
HTML Code (1990) (references)D I N I N G   P H I L O S O P H E R S   P R O B L E M |
ISO 10646 (1991-1993) (references)0044 0049 004E 0049 004E 0047      0050 0048 0049 004C 004F 0053 004F 0050 0048 0045 0052 0053      0050 0052 004F 0042 004C 0045 004D |
Encryption (beginner's substitution cypher): (references)3843484348412504243464953495042395253250524936463947 |
| 1. Crosswords 2. Orthography 3. Bibliography |
Copyright © Philip M. Parker, INSEAD. Terms of Use.