There are several topics in this link.
Multithreaded Programming with ThreadMentor: Tutorial
Edit:
Here are some direct links to the problems listed in this link, along with their initial descriptions.
ThreadMentor: Table Philosopher Problem
ThreadMentor: Table Philosopher Problem: Left-Right Version
The problem of table philosophers was invented by E.W. Dijkstra. Imagine that the five philosophers who spend their lives just think east. In the middle of the dining room is a round table with five chairs. The table has a large plate of spaghetti. However, there are only five chopsticks, as shown in the following figure. Every philosopher thinks. When he is hungry, he sits down and picks up two chopsticks that are closest to him. If a philosopher can pick up both chopsticks, he eats for a while. After the philosopher has finished eating, he puts down chopsticks and begins to think.
ThreadMentor: Cigarette Smoking Problem
This problem is associated with S. S. Patil in 1971. Suppose cigarettes require three ingredients: tobacco, paper, and a match. There are three chain smokers. Each of them has only one ingredient with an infinite supply. There is an agent that has an endless supply of all three ingredients. To make a cigarette, the smoker has tobacco (e.g., paper and match), must have two other paper and match ingredients (respectively, tobacco and match, as well as tobacco and paper). Agent and smokers share a table. The agent randomly generates two ingredients and notifies the smoker who needs these two ingredients. When the ingredients are taken from the table, the agent supplies two more. On the other hand, every smoker is waiting for an agent's notice. As soon as he is notified, the smoker will pick up the ingredients, write down a cigarette, smoke for a while and return to the table, waiting for his next ingredients.
ThreadMentor: producer / consumer problem (or limited buffer)
Suppose we have a circular buffer with two pointers in and out to indicate the next available data entry position and the position that contains the next data to be received. See the chart below. There are two groups of threads, producers and consumers. Each producer puts data elements in position and advances the pointer, and each consumer retrieves the data element in position and advances the pointer.
ThreadMentor: Roller Conveyor Problem
Suppose there are n passengers and one rollercoaster car. Passengers wait many times to travel in a car where passengers can be at maximum C, where C <n. However, a car can only move along the highway when it is full. After completing the trip, each passenger wanders around the amusement park before returning to the roller coaster for another trip. Due to safety reasons, the car only drives T times and then fired.
This has additional restrictions:
- The car always drives smoothly with passengers C;
- No passengers will jump from the car while the car is running;
- No passengers will jump on the car while the car is running;
- No passengers will be asked to drive before they can get out of the car.
ThreadMentor: Bridge Problem
The description for this depends on the images. The following is a modified quote with the removal of links to images.
Consider a narrow bridge that allows you to simultaneously allow the simultaneous intersection of three vehicles in one direction. If there are three cars on the bridge, any incoming vehicle must wait until the bridge becomes clean.
When a vehicle exits a bridge, we must consider two cases. Case 1, there are other vehicles on the bridge; and case 2 is the last car on the last bridge. In the first case, it is necessary to continue the movement of one new vehicle in the same direction.
Case 2 is more complicated and has two subcases. In this case, the exit vehicle is the last vehicle on the bridge. If there are vehicles waiting in the opposite direction, one of them should be allowed. Or, if there is no vehicle waiting in the opposite direction, then let the waiting vehicle move in the same direction.