Abstract
Lamport’s Bakery Algorithm (Commun ACM 17:453–455, 1974) implements mutual exclusion for a fixed number of threads with the first-come first-served property. It has the disadvantage, however, that it uses integer communication variables that can become arbitrarily large. Taubenfeld’s Black-White Bakery Algorithm (Proceedings of the DISC. LNCS, vol 3274, pp 56–70, 2004) keeps the integers bounded, and is adaptive in the sense that the time complexity only depends on the number of competing threads, say N. The present paper offers an assertional proof of correctness and shows that the concurrent complexity for throughput is linear in N, and for individual progress is quadratic in N. This is proved with a bounded version of UNITY, i.e., by assertional means.
Article PDF
Similar content being viewed by others
Avoid common mistakes on your manuscript.
References
Apt KR, de Boer FS, Olderog E-R: Verification of sequential and concurrent programs. Springer, New York (2009)
Aravind A: Simple, space-efficient, and fairness improved FCFS mutual exclusion algorithms. J Parallel Distrib Comput 73, 1029–1038 (2013)
Afek Y, Stupp G, Touitou D (1999) Long-lived adaptive collect with applications. In: Proceedings 40th IEEE symp. on foundations of computer science, pp 262–272
Buhr PA, Dice D, Hesselink WH (2015) High-performance N-thread software solutions for mutual exclusion. Concurr Comput Pract Exp 27:651–701. doi:10.1002/cpe.3263
Chandy KM, Misra J: Parallel program design. A foundation. Addison–Wesley, Menlo Park (1988)
Dijkstra EW: Solution of a problem in concurrent programming control. Commun ACM 8, 569 (1965)
Hesselink WH: Progress under bounded fairness. Distrib Comput 12, 197–207 (1988)
Hesselink WH: Mechanical verification of Lamport’s Bakery Algorithm. Sci Comput Program 78, 1622–1638 (2013)
Hesselink WH: Verifying a simplification of mutual exclusion by Lycklama–Hadzilacos. Acta Inf 50, 297–329 (2013)
Hesselink WH (2015) Mutual exclusion by four shared bits with not more than quadratic complexity. Sci Comput Program 102:57–75. doi:10.1016/j.scico.2015.01.001
Hesselink WH (2015) PVS proof scripts for four Bakery Algorithms. http://wimhesselink.nl/mechver/bakery/index.html. Accessed 17 March 2016
Lamport L: A new solution of Dijkstra’s concurrent programming problem. Commun ACM 17, 453–455 (1974)
Lamport L: The mutual exclusion problem—part I: a theory of interprocess communication, part II: statement and solutions. J ACM 33, 313–348 (1986)
Lamport L: On interprocess communication. Parts I and II. Distrib Comput 1, 77–101 (1986)
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
Misra J: A discipline of multiprogramming: programming theory for distributed applications. Springer, New York (2001)
Nanevski A, Ley-Wild R, Sergey I, Delbianco GA (2014) Communicating state transition systems for fine-grained concurrent resources. In: Shao Z (ed) ESOP 2014. LNCS, vol 8410, pp 290–310
Owicki S, Gries D: An axiomatic proof technique for parallel programs. Acta Inf 6, 319–340 (1976)
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. Accessed 17 March 2016
Taubenfeld G (2004) The Black-White Bakery Algorithm and related bounded-space, adaptive, local-spinning and FIFO algorithms. In: Proceedings of the DISC. LNCS, vol 3274, pp 56–70
Author information
Authors and Affiliations
Corresponding author
Additional information
Communicated by Xinyu Feng
Rights and permissions
Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.
About this article
Cite this article
Hesselink, W.H. Correctness and concurrent complexity of the Black-White Bakery Algorithm. Form Asp Comp 28, 325–341 (2016). https://doi.org/10.1007/s00165-016-0364-4
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00165-016-0364-4