Semaphore
All that busy waiting in all algorithms for mutual exclusion is pretty annoying. It’s just wasted time on the CPU. If we have just one CPU, it doesn’t make sense for that process to take up its whole quantum spinning away waiting for a shared variable to change that can’t change until the current process relinquishes the CPU!. This inspired the development of the semaphore. The name comes from old-style railroad traffic control signals where mechanical arms swing down to block a train from a section of track that another train is currently using. When the track was free, the arm would swing up, and the waiting train could now proceed.
· Synchronization tool that does not require busy waiting
· Semaphore S – integer variable
· Two standard operations modify S: wait() and signal()
· Originally called P() and V()
· Less complicated
· Can only be accessed via two indivisible (atomic) operations