Semaphore Properties
S.value >= 0 : value is the number of additional processes that can execute wait(s) without blocking.
S.value < 0 : | value | is the number of processes already blocked.
Atomicity: wait(s) and signal(s) are atomic also in the sense that no two processes can be inside wait(s) and signal(s) at the same time (not even one in wait and one in signal, even with multiple CPUs).
Practical implementation of the wait/signal critical section:
- Uniprocessor: disable interrupts.
- Multiprocessor: software or hardware schemes.