Implementing Condition Variables with Semaphores

Andrew Birrell

in Computer systems: theory, technology, and applications

Published by Springer-Verlag | 2004 | Computer systems: theory, technology, and applications edition

In 1984 a group of us at DEC SRC were implementing a new multi-processor operating system: the system was Taos, the machine was Firefly and the language, which we created, was Modula-2+. As part of that effort we implemented these threads primitives. In doing so we observed that the semantics of Acquire and Release were identical to those of a binary semaphore*. Also, the semantics of Wait and Signal are tantalizingly similar to those of a binary semaphore. So we thought we could provide a single abstraction in the kernel, and present it as locks and condition variables in the language support layer. This paper is the tale of what happened then.