It is essential to note that these operations have to be implemented
in an uninterruptible way. i.e. they are indivisible.
Semaphores may be used to protect critical regions of code simply
since they make strong synchronisation. Unfortunately, they are not
useful for distributed applications, since they are implemented by
local variables and special instructions which are not available
between different address spaces.
However, since semaphores are well understood, many programming
solutions are known using them. It is possible to show exact
equivalence of semaphores to other mutual exclusion techniques.
Figure:
Figure: