The Dining Philosophers Problem in concurrent programming

Posed and solved by Edsger Dijkstra in 1965, the Dining Philosophers Problem is a classic problem in Concurrent Programming and is often used to illustrate synchronization issues and techniques for resolving them.

Five silent philosophers are sitting around a circular table. They never talk to each other, spending their time thinking. In the middle of the table is a bowl of rice. Between each pair of adjacent philosophers, there is a chopstick and they have agreed that each will only use the chopstick to his immediate right and left when eating from the bowl of rice. So unfortunately, as philosophy is not as well paid as computing, the philosophers can only afford five chopsticks laid out on the table such that the first philosopher’s right chopstick is the left chopstick of the second philosopher, whose right chopstick is the left chopstick of the third philosopher and so forth.

Read More…

1 2 3 Scroll to top