Process Synchronization
The
Problem of Mutual Exclusion
-
Sharing a resource
-
Example of a shared print spooler, with two variables: head,
tail
-
The problem of Mutual Exclusion
-
The Critical Section
-
What guarantees do you need ?
Some attempts
to solve the problem:
What are
their drawbacks ?
-
Attempt 1: Disable all interrupts
-
Attempt 2: Provide a lock variable, test it first, and subsequently
set it, if found unlocked
-
Attempt 3: Take strict turns, change the lock variable in Attempt
2 into a 'turn' variable