Abstract
The standard implementation of mutual exclusion by means of a semaphore allows starvation of processes. Between 1979 and 1986, three algorithms were proposed that preclude starvation. These algorithms use a special kind of semaphore. We model this so-called buffered semaphore rigorously and provide mechanized proofs of the algorithms. We prove that the algorithms are three implementations of one abstract algorithm in which every competing process is overtaken not more than once by any other process. We also consider a so-called polite semaphore, which is weaker than the buffered one and is strong enough for one of the three algorithms. Refinement techniques are used to compare the algorithms and the semaphores.
Article PDF
Similar content being viewed by others
Avoid common mistakes on your manuscript.
References
Apt KR, de Boer FS, Olderog E-R (2009) Verification of sequential and concurrent programs. Springer, New York
Abadi M, Lamport L (1991) The existence of refinement mappings. Theor Comput Sci 82: 253–284
Andrews GR (2000) Foundations of multithreaded, parallel, and distributed programming. Addison Wesley, Reading
Butenhof DR (1997) Programming with POSIX threads. Addison-Wesley
Chandy KM, Misra J (1988) Parallel program design: a foundation. Addison-Wesley
Dijkstra EW (1965) Solution of a problem in concurrent programming control. Commun ACM 8:569
Dijkstra EW (1968) Co-operating sequential processes. In: Genuys F (eds) Programming languages NATO Advanced Study Institute. Academic Press, London, pp 43–112
Dijkstra EW (1968) The structure of the THE multiprogramming system. Commun ACM 11: 341–346
Dijkstra EW (1977) A strong P/V-implementation of conditional critical regions. Tech rept, Tech Univ Eindhoven, EWD 651. www.cs.utexas.edu/users/EWD
Francez N (1986) Fairness. Springer
Hesselink WH (2006) Splitting forward simulations to cope with liveness. Acta Inf 42: 583–602
Hesselink WH (2008) Universal extensions to simulate specifications. Inf Comput 206: 108–128
Hesselink WH (2011) Starvation-free mutual exclusion with semaphores. http://www.cs.rug.nl/~wim/mechver/fairMXsema.html
He J, Hoare CAR, Sanders JW (1986) Data refinement refined. In: Robinet B, Wilhelm R (eds) ESOP 86. LNCS vol 213. Springer, New York, pp 187–196
Hoare CAR (1974) Monitors: an operating system structuring concept. Commun ACM 17: 549–557
Herlihy M, Shavit N (2008) The art of multiprocessor programming. Morgan Kaufmann
Lamport L (1974) A new solution of Dijkstra’s concurrent programming problem. Commun ACM 17: 453–455
Lea D (2000) Concurrent programming in Java. Addison-Wesley
Lycklama EA, Hadzilacos V (1991) A first-come-first-served mutual-exclusion algorithm with small communication variables. ACM Trans Program Lang Syst 13: 558–576
Lehmann D, Pnueli A, Stavi J (1981) Impartiality, justice and fairness: the ethics of concurrent termination. In: Proc 8th ICALP. LNCS, vol 115. Springer, Berlin, pp 264–277
Lynch N, Vaandrager F (1995) Forward and backward simulations. Part I: untimed systems. Inf Comput 121: 214–233
Martin AJ, Burch JR (1985) Fair mutual exclusion with unfair P and V operations. Inf Process Lett 21: 97–100
Milner R (1971) An algebraic definition of simulation between programs. In: Proc 2nd int joint conf on artificial intelligence. British Comp Soc, pp 481–489
Morris JM (1979) A starvation-free solution to the mutual exclusion problem. Inf Process Lett 8: 76–80
Martin AJ, van de Snepscheut JLA (1989) Design of synchronization algorithms. In: Broy M (eds) Constructive methods in computing science. Springer, Berlin, pp 445–478
Owicki S, Gries D (1976) An axiomatic proof technique for parallel programs. Acta Inf 6: 319–340
Owre S, Shankar N, Rushby JM, Stringer-Calvert DWJ (2001) PVS version 2.4, system guide, prover guide, PVS language reference. http://pvs.csl.sri.com
Schellhorn G (2008) Completeness of ASM refinement. Electron Notes Theor Comput Sci 214: 25–49
Szymanski BK (1990) Mutual exclusion revisited. In: Proceedings of the fifth Jerusalem conference on information technology. IEEE Computer Society, pp 110–117
Tanenbaum AS (2008) Modern operating systems, 3rd edn. Pearson Education/Prentice Hall
Udding JT (1986) Absence of individual starvation using weak semaphores. Inf Process Lett 23: 159–162
Open Access
This article is distributed under the terms of the Creative Commons Attribution Noncommercial License which permits any noncommercial use, distribution, and reproduction in any medium, provided the original author(s) and source are credited.
Author information
Authors and Affiliations
Corresponding author
Additional information
Eerke Boiten
Rights and permissions
Open Access This is an open access article distributed under the terms of the Creative Commons Attribution Noncommercial License (https://creativecommons.org/licenses/by-nc/2.0), which permits any noncommercial use, distribution, and reproduction in any medium, provided the original author(s) and source are credited.
About this article
Cite this article
Hesselink, W.H., IJbema, M. Starvation-free mutual exclusion with semaphores. Form Asp Comp 25, 947–969 (2013). https://doi.org/10.1007/s00165-011-0219-y
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00165-011-0219-y