\"\" \"\" \"\"
Go backward to Shared Memory Synchronization
Go up to Top
Go forward to Lock Variables
RISC-Linz logo

Synchronization Mechanisms

Lock variable ("mutex")
mutex lock = INIT();
P: loop             C: loop
     v = produce()       LOCK(lock)
     LOCK(lock)          C2
     C1                  UNLOCK(lock)
     UNLOCK(lock)        consume(v)
Only one process can have lock => only one process can enter critical region!
Author: Wolfgang Schreiner
Last modification: November 15, 1996