Concurrency Control 53
Semaphores
Semaphores, described in detail shortly, are a simple method for synchro-
nization. A semaphore is an object that is atomically modified using either
increment or decrement operations, where one is defined as blocking when
the semaphore has some special value, such as zero. As such, a semaphore
implementation also includes a queue used to manage blocked operations to
allow them to proceed in an ordered fashion as the state of the semaphore
changes. A semaphore can be used to implement not only locks, but more
general forms of synchronization. Say two processes are executing, and one
needs to know at some points during its execution whether or not the other
thread has reached a certain state (and possibly continued past ...