Skip to main content

Under the Hood of the Bakery Algorithm: Mutual Exclusion as a Matter of Priority

  • Conference paper
  • First Online:
Structural Information and Communication Complexity (SIROCCO 2015)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 9439))

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Abraham, U.: Logical classification of distributed algorithms (Bakery Algorithms as an example). Theor. Comput. Sci. 412(25), 2724–2745 (2011)

    Article  MathSciNet  MATH  Google Scholar 

  2. Anderson, J.H.: Lamport on mutual exclusion: 27 years of planting seeds. In: Proceedings of the 20th ACM PODC Conference, pp. 3–12 (2001)

    Google Scholar 

  3. Attiya, H., Welch, J.: Distributed computing: fundamentals, simulations, and advanced topics, vol. 19 (2004)

    Google Scholar 

  4. 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)

    Chapter  Google Scholar 

  5. Dijkstra, E.W.: Solution of a problem in concurrent programming control. Commun. ACM 8(9), 569 (1965)

    Article  Google Scholar 

  6. Fagin, R., Halpern, J.Y., Moses, Y., Vardi, M.Y.: Reasoning about Knowledge (2003)

    Google Scholar 

  7. Halpern, J.Y., Moses, Y.: Knowledge and common knowledge in a distributed environment. Journal of the ACM 37(3), 549–587 (1990)

    Article  MathSciNet  MATH  Google Scholar 

  8. Hesselink, W.H.: Mechanical verification of Lamport’s Bakery Algorithm. Science of Computer Programming 78(9), 1622 (2013)

    Article  Google Scholar 

  9. Lamport, L.: A new solution of Dijkstra’s concurrent programming problem. Commun. ACM 17(8), 453–455 (1974)

    Article  MathSciNet  MATH  Google Scholar 

  10. Lamport, L.: A new approach to proving the correctness of multiprocess programs. ACM Trans. Program. Lang. Syst. 1(1), 84–97 (1979)

    Article  MATH  Google Scholar 

  11. 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)

    Google Scholar 

  12. Lamport, L.: On Interprocess Communication. Part I: Basic Formalism. Distributed Computing 1(2), 77–85 (1986)

    MATH  Google Scholar 

  13. Lamport, L.: A fast mutual exclusion algorithm. ACM Trans. Comput. Syst. 5(1), 1–11 (1987)

    Article  Google Scholar 

  14. Lamport, L.: A TLA+ mechanical proof of the Boulangerie Algorithm (2015). http://research.microsoft.com/en-us/um/people/lamport/tla/boulangerie.html

  15. Lamport, L.: The TLA+ Hyperbook (2015). http://research.microsoft.com/en-us/um/people/lamport/tla/hyperbook.html

  16. Lynch, N.A.: Distributed Algorithms (1996)

    Google Scholar 

  17. Raynal, M., Beeson, D.: Algorithms for Mutual Exclusion (1986)

    Google Scholar 

  18. 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)

    Google Scholar 

  19. 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)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics