Getting Started

The Dining Philosophers Problem is a popular way of thinking about concurrency issues in computers. Throughout this lesson you will learn how this problem is at work behind the scenes every time you use your computer.

Suppose we have five philosophers sitting around a table. Each philosopher has a plate of food in front of them. Between each pair of philosophers is a single chopstick. How do we get the philosophers to share the chopsticks without communicating and such that no philosopher starves?

Main problems to avoid:

Deadlock:


There are several problems that arise when we try to find a solution to the Dining Philosophers Problem. One such problem is called deadlock. This occurs when philosophers have claimed one chopstick each but there are no more chopsticks for any of them to claim. Thus no philosopher is able to eat as all are waiting for a second chopstick.

image not displaying

Starvation:


Another major issue that arises in this problem is called starvation. Starvation occurs when one philosopher never gets the chopsticks because they are claimed every time that philosopher attempts to claim one.

image not displaying