A Correct and Unrestrictive Implementation of General Semaphores


The important point to note in this code is that if one at tempts to V a general semaphore whose value is less than or equal to zero, then the process calling V will not release mutual exclusion (i.e., it will not execute VB(s.mutex)) before its return from V. The retention of mutual exclusion is the mechanism by which the error in the traditional construction, as demonstrated by Kotulski, is eliminated. However, the retention of mutual exclusion results in general semaphores whose use is restrictive. Certain behaviors of a system which utilizes such semaphores would be proscribed by Hemmindinger's implementation. More specifically, if the value of s.count is negative (and, consequently, there are a number of processes suspended on s.d~lay), this implementation will not permit a sequence of V operations to be executed. There will be a lockstep sequence of a V followed by the completion of a suspended P until s.count becomes non-negative. Such restricted behavior could possibly have substantial performance penalties in certain system contexts. A criticism of

DOI: 10.1145/54289.54293

Extracted Key Phrases

1 Figure or Table

Cite this paper

@article{Kearns1988ACA, title={A Correct and Unrestrictive Implementation of General Semaphores}, author={Phil Kearns}, journal={Operating Systems Review}, year={1988}, volume={22}, pages={46-48} }