skip to main content
10.1145/3409390.3409411acmotherconferencesArticle/Chapter ViewAbstractPublication PagesicppConference Proceedingsconference-collections
research-article

Avoiding Register Overflow in the Bakery Algorithm

Published:17 August 2020Publication History

ABSTRACT

Computer systems are designed to make resources available to users and users may be interested in some resources more than others, therefore, a coordination scheme is required to satisfy the users’ requirements. This scheme may implement certain policies such as “never allocate more than X units of resource Z”. One policy that is of particular interest is the inability of users to access a single resource at the same time, which is called the problem of mutual exclusion. Resource management concerns the coordination and collaboration of users, and it is usually based on making a decision. In the case of mutual exclusion, that decision is about granting access to a resource. Therefore, mutual exclusion is useful for supporting resource access management. The first true solution to the mutual exclusion problem is known as the Bakery algorithm that does not rely on any lower-lever mutual exclusion. We examine the problem of register overflow in real-world implementations of the Bakery algorithm and present a variant algorithm named Bakery++ that prevents overflows from ever happening. Bakery++ avoids overflows without allowing a process to write into other processes’ memory and without using additional memory or complex arithmetic or redefining the operations and functions used in Bakery. Bakery++ is almost as simple as Bakery and it is straightforward to implement in real systems. With Bakery++, there is no reason to keep implementing Bakery in real computers because Bakery++ eliminates the probability of overflows and hence it is more practical than Bakery. Previous approaches to circumvent the problem of register overflow included introducing new variables or redefining the operations or functions used in the original Bakery algorithm, while Bakery++ avoids overflows by using simple conditional statements. The result is a new mutual exclusion algorithm that is guaranteed never to allow an overflow and it is simple, correct and easy to implement. Bakery++ has the same temporal and spatial complexities as the original Bakery. We have specified Bakery++ in PlusCal and we have used the TLC model checker to assert that Bakery++ maintains the mutual exclusion property and that it never allows an overflow.

References

  1. A. Aravind. 2010. Highly-Fair Bakery Algorithm Using Symmetric Tokens. Inf. Process. Lett. 110, 23 (2010), 1055–1060. DOI:https://doi.org/10.1016/j.ipl.2010.09.004Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. A. Aravind and Wim H. Hesselink. 2011. Nonatomic Dual Bakery Algorithm with Bounded Tokens. Acta Inform. 48, 2 (2011), 67–96. DOI:https://doi.org/10.1007/s00236-011-0132-0Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Wybe Dijkstra. 1965. Solution of a Problem in Concurrent Programming Control. Commun. ACM 8, 9 (1965), 569. DOI:https://doi.org/10.1145/365559.365617Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Jayanti, King Tan, Gregory Friedland, and Amir Katz. 2001. Bounding Lamport's Bakery Algorithm. In Proceedings of the International Conference on Current Trends in Theory and Practice of Computer Science, Springer, Piešt'any, Slovak Republic, 261–270. DOI:https://doi.org/10.1007/3-540-45627-9_23Google ScholarGoogle Scholar
  5. E. Knuth. 1966. Additional Comments on a Problem in Concurrent Programming Control. Commun. ACM 9, 5 (1966), 321–322. DOI:https://doi.org/10.1145/355592.365595Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Lamport. 1974. A New Solution of Dijkstra's Concurrent Programming Problem. Commun. ACM 17, 8 (1974), 453–455. DOI:https://doi.org/10.1145/361082.361093Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Lamport. 2012. How to Write a 21st Century Proof. Journal of Fixed Point Theory and Applications 11, 1 (2012), 43–63. DOI:https://doi.org/10.1007/s11784-012-0071-6Google ScholarGoogle ScholarCross RefCross Ref
  8. Lamport. The Writings of Leslie Lamport. Retrieved March 6, 2020 from http://lamport.azurewebsites.net/pubs/pubs.htmlGoogle ScholarGoogle Scholar
  9. W. van der Sommen, W. H. J. Feijen, and A. J. M. van Gasteren. 1997. Peterson's Mutual Exclusion Algorithm Revisited. Science of Computer Programming 29, 3 (1997), 327–334. DOI:https://doi.org/10.1016/S0167-6423(97)00003-8Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. K. Szymanski. 1990. Mutual Exclusion Revisited. In Proceedings of the Fifth Jerusalem Conference on Information Technology, IEEE, Jerusalem, Israel, 110–117. DOI:https://doi.org/10.1109/JCIT.1990.128275Google ScholarGoogle ScholarCross RefCross Ref
  11. Taubenfeld. 2004. The Black-White Bakery Algorithm and Related Bounded-Space, Adaptive, Local-Spinning and FIFO Algorithms. In Proceedings of the International Symposium on Distributed Computing (DISC ’04), Springer, Amsterdam, The Netherlands, 56–70. DOI:https://doi.org/10.1007/978-3-540-30186-8_5Google ScholarGoogle Scholar
  12. Young Yoon, Mosharaf Chowdhury, and Barzan Mozafari. 2018. Distributed Lock Management with RDMA: Decentralization without Starvation. In Proceedings of the International Conference on Management of Data (SIGMOD ’18), ACM, Houston, TX, USA, 1571–1586. DOI:https://doi.org/10.1145/3183713.3196890Google ScholarGoogle ScholarDigital LibraryDigital Library

Recommendations

Comments

Login options

Check if you have access through your login credentials or your institution to get full access on this article.

Sign in
  • Published in

    cover image ACM Other conferences
    ICPP Workshops '20: Workshop Proceedings of the 49th International Conference on Parallel Processing
    August 2020
    186 pages
    ISBN:9781450388689
    DOI:10.1145/3409390

    Copyright © 2020 ACM

    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    • Published: 17 August 2020

    Permissions

    Request permissions about this article.

    Request Permissions

    Check for updates

    Qualifiers

    • research-article
    • Research
    • Refereed limited

    Acceptance Rates

    Overall Acceptance Rate91of313submissions,29%
  • Article Metrics

    • Downloads (Last 12 months)10
    • Downloads (Last 6 weeks)0

    Other Metrics

PDF Format

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

HTML Format

View this article in HTML Format .

View HTML Format