Deadlock & Concurrency
Algorithms
Lock Variable
TSL Mechanism
Turn Variable
Binary Semaphore
Counting Semaphore
Peterson Solution
Producer & Consumer
Dining Philosopher
Banker's algorithm
Peterson's Algorithm
Entry Section
other = 1-process;
interested[process]=TRUE;
turn=process;
while(interested[Other]==
TRUE && turn==process);
Critical Section
Exit Section
interested[process]=FALSE;
Process 0
Process 1
Entry Section
Crititcal section
Exit Section
Turn value =
Interested [Process 0] =
Interested [Process 1] =
Process in Waiting queue