Abstract
A new approach to the study and analysis of Mutual Exclusion (ME) algorithms is presented, based on identifying the priority relation that the ME algorithm constructs. It is argued that by analyzing how a process detects that it has priority over all other processes, ME algorithms can be better understood and improved. The approach is illustrated by applying it to Lamport’s celebrated Bakery algorithm in the safe register SWMR model. By analyzing how Bakery established and detects priority, cases in which the Bakery algorithm causes processes to block unnecessarily are identified. Namely, a process that already knows that it has priority over another process is made to perform reads and wait on registers of the other process. An optimized version of the Bakery algorithm, called Boulangerie, is proposed, and is shown to be free of any unnecessary blocking. A second contribution of the approach is obtaining a clear explanation for how the Bakery algorithm uses reads from safe registers to detect that a process has priority. Our analysis provides more insight into the workings of the Bakery algorithm than is obtained by other proofs of its correctness.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Abraham, U.: Logical classification of distributed algorithms (Bakery Algorithms as an example). Theor. Comput. Sci. 412(25), 2724–2745 (2011)
Anderson, J.H.: Lamport on mutual exclusion: 27 years of planting seeds. In: Proceedings of the 20th ACM PODC Conference, pp. 3–12 (2001)
Attiya, H., Welch, J.: Distributed computing: fundamentals, simulations, and advanced topics, vol. 19 (2004)
Chaudhuri, K., Doligez, D., Lamport, L., Merz, S.: Verifying safety properties with the TLA+ proof system. In: Giesl, J., Hähnle, R. (eds.) IJCAR 2010. LNCS, vol. 6173, pp. 142–148. Springer, Heidelberg (2010)
Dijkstra, E.W.: Solution of a problem in concurrent programming control. Commun. ACMÂ 8(9), 569 (1965)
Fagin, R., Halpern, J.Y., Moses, Y., Vardi, M.Y.: Reasoning about Knowledge (2003)
Halpern, J.Y., Moses, Y.: Knowledge and common knowledge in a distributed environment. Journal of the ACM 37(3), 549–587 (1990)
Hesselink, W.H.: Mechanical verification of Lamport’s Bakery Algorithm. Science of Computer Programming 78(9), 1622 (2013)
Lamport, L.: A new solution of Dijkstra’s concurrent programming problem. Commun. ACM 17(8), 453–455 (1974)
Lamport, L.: A new approach to proving the correctness of multiprocess programs. ACM Trans. Program. Lang. Syst. 1(1), 84–97 (1979)
Lamport, L.: What it means for a concurrent program to satisfy a specification: Why no one has specified priority. In: Proceedings of the 12th ACM POPL, pp. 78–83 (1985)
Lamport, L.: On Interprocess Communication. Part I: Basic Formalism. Distributed Computing 1(2), 77–85 (1986)
Lamport, L.: A fast mutual exclusion algorithm. ACM Trans. Comput. Syst. 5(1), 1–11 (1987)
Lamport, L.: A TLA+ mechanical proof of the Boulangerie Algorithm (2015). http://research.microsoft.com/en-us/um/people/lamport/tla/boulangerie.html
Lamport, L.: The TLA+ Hyperbook (2015). http://research.microsoft.com/en-us/um/people/lamport/tla/hyperbook.html
Lynch, N.A.: Distributed Algorithms (1996)
Raynal, M., Beeson, D.: Algorithms for Mutual Exclusion (1986)
Rosenzweig, D., Börger, E., Gurevich, Y.: The bakery algorithm: yet another specification and verification. In: Börger, E. (ed.) Specification and Validation Methods, pp. 231–243 (1995)
Sedletsky, E., Pnueli, A., Ben-Ari, M.: Formal verification of the ricart-agrawala algorithm. In: Kapoor, S., Prasad, S. (eds.) FST TCS 2000. LNCS, vol. 1974, pp. 325–335. Springer, Heidelberg (2000)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2015 Springer International Publishing Switzerland
About this paper
Cite this paper
Moses, Y., Patkin, K. (2015). Under the Hood of the Bakery Algorithm: Mutual Exclusion as a Matter of Priority. In: Scheideler, C. (eds) Structural Information and Communication Complexity. SIROCCO 2015. Lecture Notes in Computer Science(), vol 9439. Springer, Cham. https://doi.org/10.1007/978-3-319-25258-2_28
Download citation
DOI: https://doi.org/10.1007/978-3-319-25258-2_28
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-25257-5
Online ISBN: 978-3-319-25258-2
eBook Packages: Computer ScienceComputer Science (R0)