Competing Threads


Goat rodeo: A very chaotic situation (Thread Race Condition)

We will use the term in the context of a process with multiple simultanious threads being scheduled only by the operating system, essentially somewhat at random.

Edsger Dijkstra's Dining Philosophers Problem (Thread Deadlock)

Five philosophers, each speaking a different languages, sit at a round table with bowls of rice in front of them . Chopsticks are placed on the table, one between each pair of adjacent bowls. For the purposes of this discussion, we consider philosophers as only having access to the two chopsticks to the left and right of the bowl in front of the them.

Each philosopher alternately think's and eat's some of the rice . However, a philosopher can only eat when he has both left and right chopstick. So after he finishes eating, he needs to put down both chopsticks so they become available to others. A philosopher can take the chopsticks one at a time to right or to the left as they become available, but can't start eating before getting both of them.

Dining Philosopher

The Problem: Since they can't communicate, it is possible for each philosopher to get one chopstick and be waiting for the second, so nobody eats. In the original formulation, now about 50 years ago, the philosophers were Processes or Threads and the bowls of rice were disk drives, or tape drives, or computer memory.