Shared Memory Synchronization
Semaphores (Dijkstra)
Semaphore s = INIT(1)
P1: loop P2: loop
P(s) P(s)
C1 C2
V(s) V(s)
- Counter variable holding natural number.
- Atomic operations and .
- : if then else block.
- : if processes blocked on then release some process else
.
Typically implemented by locks!
Author: Wolfgang Schreiner
Last modification: November 15, 1996