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.
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarCross Ref
- Lamport. The Writings of Leslie Lamport. Retrieved March 6, 2020 from http://lamport.azurewebsites.net/pubs/pubs.htmlGoogle Scholar
- 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 ScholarDigital Library
- 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 ScholarCross Ref
- 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 Scholar
- 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 ScholarDigital Library
Recommendations
Under the Hood of the Bakery Algorithm: Mutual Exclusion as a Matter of Priority
SIROCCO 2015: Post-Proceedings of the 22nd International Colloquium on Structural Information and Communication Complexity - Volume 9439A 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 ...
Highly-fair bakery algorithm using symmetric tokens
This note proposes a new version of the bakery algorithm that: (i) assures fair tie-breaking when two or more processes choose same token number; and (ii) bounds the token numbers within the range [-n,n]. The algorithm is simple and uses one additional ...
Application of finite state automata to the bakery algorithm in critical section modeling
The Bakery Algorithm (BA), developed by Dr. Leslie Lamport [1], is utilized as a method to a critical section (CS) problem modeling. A common solution to a CS problem in Operating Systems (OS) must satisfy the three requirements: (1) mutual exclusion; (...
Comments