Lee Cheon-Sin
May 15th, 2006, 07:09 PM
1. You have a program. That is your city.
2. Your program is single-threaded. You have one road for the city-dwellers to use. All the cars are getting to their destinations—but there is much traffic congestion, because the cars in front have to move before the cars behind can move.
3. Your program is multi-threaded. You have many roads and intersections. Cars are crashing into each other because the of the absense of traffic signals.
4. Your program uses Mutexes and Semaphores. You have traffic lights to control the traffic. All the cars run smoothly, and get to their destinations in a timely manner.
2. Your program is single-threaded. You have one road for the city-dwellers to use. All the cars are getting to their destinations—but there is much traffic congestion, because the cars in front have to move before the cars behind can move.
3. Your program is multi-threaded. You have many roads and intersections. Cars are crashing into each other because the of the absense of traffic signals.
4. Your program uses Mutexes and Semaphores. You have traffic lights to control the traffic. All the cars run smoothly, and get to their destinations in a timely manner.