Operating System Solution - Semaphore
Synchronization tool that does not require busy waiting.
Can only be accessed via two atomic operations, which logically look like this:
s : integer
wait(s): while s ? 0 do no-op
s := s - 1;
signal(s): s:= s + 1;
mutex : semaphore :=1;
Repeat
wait( mutex );
critical section
signal( mutex );
remainder section
Forever
Previous slide
Next slide
Back to first slide
View graphic version