Classic Problems in Concurrency
Every student of distributed computing should know quite a bit about the fundamentals of concurrency. A good chunk of that is knowing why the following problems (not necessarily their solutions) are worthy of study.
The classic problems mentioned below are well defined; so do a web search.
1 Dining Philosophers Problem
- Illustrates deadlock
 - Illustrates livelock
 - Illustrates malicious cooperation
 - Assume or not: Communication among them
 
2 Mutual Exclusion Problem
- Consider two or more processes. Each Pi has an area of code Ci "sensitive enough" that we call it a "critical section" CS.
 - Assume CS always terminates.
 - "Sensitive enough" == shared variable, usually
 
2.1 Mutual Exclusion Problem
- Find a solution that satisfies four requirements:
- R1 Mutual Exclusion: Number of processes in the CS, at any time == 0 or 1.
 - R2: Deadlock-Free + Live-lock-free
 - R3: No Unnecessary Delay
 - R4: Eventual Entry or Bounded Waiting: A process wishing to enter its CS, must be able to enter it in a finite amount of wait.
 
 
2.2 Mutual Exclusion Problem
- Typically solved with semaphores.  
- m : semaphore := 1
 - Entry to CS: P(m);
 - Exit from CS: V(m);
 
 
2.3 Mutual Exclusion Problem
- Also, read about solutions such as Dekker's and Peterson's, using ordinary variables.
 
2.4 Mutual Exclusion Problem
- Two processes can illustrate the essence of the issue, but we
are also interested in "starvation-free" semaphore based
solutions, especially in distributed systems.
- The above solution is not starvation free.
 
 - Starvation-free Mutex Solutions Using Split Binary Semaphores
 
3 Readers-Writers Problem
- Read-Sharing a resource
 - Exclusive update of the resource
 - Andrews' Notes on Passing The Baton Technique
 - Parnas readers-writers
 
4 Producers-Consumers Problem
- aka Bounded Buffer Problem
 - Producers-Consumers Problem
 
5 Cigarette Smokers Problem
- What problems of concurrency can semaphores solve?
 - Introduces an array of semaphores.
 - Cigarette Smokers Problem cannot be solved without arrays.
 - Cigarette Smokers Problem