10.4. Semaphores

In 1968 Edsger Dijkstra published a paper on the design of a small but carefully structured operating system called THE, which is described in Section 11.2. The design was based on a small, static number of concurrent processes which synchronized with each other and with the hardware by means of a mechanism called a semaphore.

A semaphore is an object with operations semSignal () and semWait (). The attributes of a semaphore are typically an integer and a queue (Figure 10.9). The definitions of the semaphore operations are as follows:

semWait ()If the value of the semaphore's integer is greater than zero then decrement it and allow the process to continue, else suspend the process (noting that it is blocked on this semaphore). ...

Get Operating Systems: Concurrent and Distributed Software Design now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.