{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,3,20]],"date-time":"2026-03-20T13:30:21Z","timestamp":1774013421074,"version":"3.50.1"},"reference-count":42,"publisher":"MDPI AG","issue":"3","license":[{"start":{"date-parts":[[2026,3,20]],"date-time":"2026-03-20T00:00:00Z","timestamp":1773964800000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Computers"],"abstract":"<jats:p>Lamport\u2019s Bakery algorithm is a well-known, simple, and elegant solution to the mutual exclusion problem for N \u2265 2 concurrent\/parallel processes. However, the algorithm generates an unbounded number of tickets, even when only 2 processes are arbitrated. Various proposals in the literature were introduced to bound the number of tickets. Anyway, almost all these proposals prove to be correct when operated with atomic registers (AR) only. They become incorrect when working with non-atomic registers (NAR), as may occur in embedded hardware platforms with multi-port memory and relaxed memory-bus control, such as microcontrollers, FPGA-based systems, or specialized network devices. A notable solution with bounded tickets is Taubenfeld\u2019s Black-White Bakery (BWB) algorithm. BWB relies on tickets which are couples &lt;number,mycolor&gt; where mycolor can be Black or White and number ranges in [0, N]. BWB, too, was confirmed, through informal reasoning, it is correct with AR only. The original contribution of this paper is a reformulation of BWB, which is formally modelled and exhaustively verified by timed automata in the Uppaal toolbox. In the reformulation, a ticket\u2019s couple is coded as a single integer, and decoded and processed according to the BWB logic. The reformulated BWB remains fully correct with AR regardless of the number N of processes, but it is also correct with NAR for N = 2 processes. As a further original contribution, the paper demonstrates that the BWB version for 2 processes can be embedded in a general, state-of-the-art solution, based on a binary tournament tree (TT), to become AR\/NAR correct, that is, RW-safe, for any number of processes. However, due to model complexity, the correctness of the TT versions of BWB, that is, based on atomic and non-atomic registers, is mainly studied by stochastic simulation of the formal model reduced to actors in Java.<\/jats:p>","DOI":"10.3390\/computers15030196","type":"journal-article","created":{"date-parts":[[2026,3,20]],"date-time":"2026-03-20T10:49:58Z","timestamp":1774003798000},"page":"196","update-policy":"https:\/\/doi.org\/10.3390\/mdpi_crossmark_policy","source":"Crossref","is-referenced-by-count":0,"title":["Black-White Bakery Algorithm Made RW-Safe"],"prefix":"10.3390","volume":"15","author":[{"ORCID":"https:\/\/orcid.org\/0000-0001-6577-4777","authenticated-orcid":false,"given":"Libero","family":"Nigro","sequence":"first","affiliation":[{"name":"Engineering Department of Informatics Modelling Electronics and Systems Science, University of Calabria, 87036 Rende, Italy"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-6138-5739","authenticated-orcid":false,"given":"Franco","family":"Cicirelli","sequence":"additional","affiliation":[{"name":"CNR\u2014National Research Council of Italy, Institute for High Performance Computing and Networking (ICAR), 87036 Rende, Italy"}],"role":[{"role":"author","vocabulary":"crossref"}]}],"member":"1968","published-online":{"date-parts":[[2026,3,20]]},"reference":[{"key":"ref_1","doi-asserted-by":"crossref","first-page":"569","DOI":"10.1145\/365559.365617","article-title":"Solution of a problem in concurrent programming control","volume":"8","author":"Dijkstra","year":"1965","journal-title":"Comm. ACM"},{"key":"ref_2","unstructured":"Lamport, L. (2019). The mutual exclusion problem: Part I\u2014A theory of interprocess communication. Concurrency: The Works of Leslie Lamport, Association for Computing Machinery."},{"key":"ref_3","unstructured":"Lamport, L. (2019). The mutual exclusion problem: Part II\u2014Statement and solutions. Concurrency: The Works of Leslie Lamport, Association for Computing Machinery."},{"key":"ref_4","unstructured":"Taubenfeld, G. (2006). Synchronization Algorithms and Concurrent Programming, Pearson\/Prentice Hall."},{"key":"ref_5","unstructured":"Genuys, F. (1968). Co-operating sequential processes. Programming Languages: NATO Advanced Study Institute, Academic Press."},{"key":"ref_6","doi-asserted-by":"crossref","unstructured":"Alberts, G., and Groote, J.F. (2022). History of Dekker\u2019s algorithm for mutual exclusion. Tales of Electrologica: Computers, Software and People, Springer Nature. Chapter 6.","DOI":"10.1007\/978-3-031-13033-5"},{"key":"ref_7","doi-asserted-by":"crossref","first-page":"47","DOI":"10.1016\/j.tcs.2022.03.030","article-title":"A visit to mutual exclusion in seven dates","volume":"919","author":"Raynal","year":"2022","journal-title":"Theor. Comput. Sci."},{"key":"ref_8","unstructured":"Raynal, M. (1986). Algorithms for Mutual Exclusion Problem, The MIT Press."},{"key":"ref_9","doi-asserted-by":"crossref","first-page":"694","DOI":"10.3390\/modelling5030037","article-title":"Correctness verification of mutual exclusion algorithms by model checking","volume":"5","author":"Nigro","year":"2024","journal-title":"Modelling"},{"key":"ref_10","doi-asserted-by":"crossref","first-page":"139","DOI":"10.1109\/LES.2024.3485509","article-title":"Configurable multiport memory architecture for high-speed data communication","volume":"17","author":"Dhakad","year":"2024","journal-title":"IEEE Embed. Syst. Lett."},{"key":"ref_11","doi-asserted-by":"crossref","first-page":"629","DOI":"10.1145\/2872887.2750376","article-title":"Mbus: An ultra-low power interconnect bus for next generation nanopower systems","volume":"43","author":"Pannuto","year":"2015","journal-title":"ACM SIGARCH Comput. Archit. News"},{"key":"ref_12","unstructured":"Frenzel, L.E. (2026, March 10). Dual-Port SRAM Accelerates Smart-Phone Development. Electronic Design 2004. Available online: https:\/\/www.electronicdesign.com\/technologies\/industrial\/boards\/article\/21774041\/dual-port-sram-accelerates-smart-phone-development."},{"key":"ref_13","unstructured":"Lamport, L. (1985). Interprocess Communication, SRI International. Final Report for ONR Project, N00014-84-C-0621."},{"key":"ref_14","doi-asserted-by":"crossref","first-page":"199","DOI":"10.1007\/s00236-013-0178-2","article-title":"Verifying a simplification of mutual exclusion by Lycklama-Hadzilacos","volume":"50","author":"Hesselink","year":"2013","journal-title":"Acta Inform."},{"key":"ref_15","doi-asserted-by":"crossref","first-page":"325","DOI":"10.1007\/s00165-016-0364-4","article-title":"Correctness and concurrent complexity of the Black-White Bakery Algorithm","volume":"28","author":"Hesselink","year":"2016","journal-title":"Form. Asp. Comput."},{"key":"ref_16","unstructured":"B\u00f6rger, E., Gurevich, Y., and Rosenzweig, D. (1995). The bakery algorithm: Yet another specification and verification. Specification and Validation Methods, Oxford University Press."},{"key":"ref_17","doi-asserted-by":"crossref","unstructured":"Nigro, L. (2024). Verifying mutual exclusion algorithms with non-atomic registers. Algorithms, 17.","DOI":"10.3390\/a17120536"},{"key":"ref_18","doi-asserted-by":"crossref","first-page":"144","DOI":"10.1002\/cpe.3659","article-title":"Dekker\u2019s mutual exclusion algorithm made RW-safe","volume":"28","author":"Buhr","year":"2016","journal-title":"Concurr. Comput. Pract. Exp."},{"key":"ref_19","unstructured":"Lamport, L. (2026). A Science of Concurrent Programs, Cambridge University Press."},{"key":"ref_20","unstructured":"Clarke, E.M., Grumberg, O., and Peled, D.A. (2000). Model Checking, MIT Press."},{"key":"ref_21","unstructured":"Spronck, M., and Luttik, B. (2023). Process-algebraic models of multi-writer multi-reader non-atomic registers. Proceedings of the 34th International Conference on Concurrency Theory (CONCUR) 2023, Antwerp, Belgium, 18\u201323 September 2023, Schloss Dagstuhl."},{"key":"ref_22","unstructured":"van Glabbeek, R., Luttik, B., and Spronck, M. (2025). Just verification of mutual exclusion algorithms. arXiv."},{"key":"ref_23","doi-asserted-by":"crossref","unstructured":"Groote, J.F., Keiren, J.J., Luttik, B., de Vink, E.P., and Willemse, T.A. (2020). Modelling and nalyzing software in mCRL2. Formal Aspects of Component Software, Proceedings of the 16th International Conference, FACS 2019, Amsterdam, The Netherlands, 23\u201325 October 2019, Springer International Publishing. Proceedings 16.","DOI":"10.1007\/978-3-030-40914-2_2"},{"key":"ref_24","doi-asserted-by":"crossref","first-page":"183","DOI":"10.1016\/0304-3975(94)90010-8","article-title":"A theory of timed automata","volume":"126","author":"Alur","year":"1994","journal-title":"Theor. Comput. Sci."},{"key":"ref_25","doi-asserted-by":"crossref","first-page":"272","DOI":"10.1002\/spe.3372","article-title":"A comprehensive survey of UPPAAL-assisted formal modeling and verification","volume":"55","author":"Zhou","year":"2024","journal-title":"Softw. Pract. Exp."},{"key":"ref_26","doi-asserted-by":"crossref","unstructured":"Nigro, L. (2025). Formal analysis of bakery-based mutual exclusion algorithms. Computers, 14.","DOI":"10.3390\/computers14120507"},{"key":"ref_27","doi-asserted-by":"crossref","first-page":"67","DOI":"10.1007\/s00236-011-0132-0","article-title":"Nonatomic dual bakery algorithm with bounded tokens","volume":"48","author":"Aravind","year":"2011","journal-title":"Acta Inform."},{"key":"ref_28","doi-asserted-by":"crossref","unstructured":"Bernardo, M., and Corradini, F. (2004). A tutorial on UPPAAL. Formal Methods for the Design of Real-Time Systems, Springer. LNCS 3185.","DOI":"10.1007\/b110123"},{"key":"ref_29","doi-asserted-by":"crossref","first-page":"397","DOI":"10.1007\/s10009-014-0361-y","article-title":"Uppaal SMC tutorial","volume":"17","author":"David","year":"2015","journal-title":"Int. J. Softw. Tools Technol. Transf."},{"key":"ref_30","doi-asserted-by":"crossref","unstructured":"Clarke, E.M., Klieber, W., Nov\u00e1\u010dek, M., and Zuliani, P. (2011). Model checking and the state explosion problem. LASER Summer School on Software Engineering, Springer.","DOI":"10.1007\/978-3-642-35746-6_1"},{"key":"ref_31","doi-asserted-by":"crossref","first-page":"1","DOI":"10.1145\/3158668","article-title":"A survey of statistical model checking","volume":"28","author":"Agha","year":"2018","journal-title":"ACM Trans. Model. Comput. Simul."},{"key":"ref_32","doi-asserted-by":"crossref","first-page":"102189","DOI":"10.1016\/j.simpat.2020.102189","article-title":"Parallel Theatre: An actor framework in Java for high performance computing","volume":"106","author":"Nigro","year":"2021","journal-title":"Simul. Model. Pract. Theory"},{"key":"ref_33","doi-asserted-by":"crossref","unstructured":"Taubenfeld, G. (2004). The black-white bakery algorithm and related bounded-space, adaptive, local-spinning and FIFO algorithms. International Symposium on Distributed Computing 2004, Springer.","DOI":"10.1007\/978-3-540-30186-8_5"},{"key":"ref_34","doi-asserted-by":"crossref","first-page":"453","DOI":"10.1145\/361082.361093","article-title":"A new solution of Dijkstra\u2019s concurrent programming problem","volume":"17","author":"Lamport","year":"1974","journal-title":"Comm. ACM"},{"key":"ref_35","doi-asserted-by":"crossref","first-page":"1055","DOI":"10.1016\/j.ipl.2010.09.004","article-title":"Highly-fair bakery algorithm using symmetric tokens","volume":"110","author":"Aravind","year":"2010","journal-title":"Inf. Process. Lett."},{"key":"ref_36","doi-asserted-by":"crossref","unstructured":"Sayyadabdi, A., and Sharifi, M. (2020). Avoiding register overflow in the bakery algorithm. Workshop Proceedings of the 49th International Conference on Parallel Processing 2020, Association for Computing Machinery.","DOI":"10.1145\/3409390.3409411"},{"key":"ref_37","doi-asserted-by":"crossref","unstructured":"Jayanti, P., Tan, K., Friedland, G., and Katz, A. (2001). Bounding Lamport\u2019s bakery algorithm. International Conference on Current Trends in Theory and Practice of Computer Science 2001, Springer.","DOI":"10.1007\/3-540-45627-9_23"},{"key":"ref_38","doi-asserted-by":"crossref","first-page":"135","DOI":"10.1007\/BF00288966","article-title":"Arbitration without common modifiable variables","volume":"17","author":"Kessels","year":"1982","journal-title":"Acta Inform."},{"key":"ref_39","doi-asserted-by":"crossref","first-page":"833","DOI":"10.1007\/s00165-016-0407-x","article-title":"Tournaments for mutual exclusion: Verification and concurrent complexity","volume":"29","author":"Hesselink","year":"2017","journal-title":"Form. Asp. Comput."},{"key":"ref_40","doi-asserted-by":"crossref","first-page":"236","DOI":"10.3934\/aci.2025014","article-title":"Formal verification of mutual exclusion algorithms in anonymous memory","volume":"5","author":"Nigro","year":"2025","journal-title":"Appl. Comput. Intell."},{"key":"ref_41","doi-asserted-by":"crossref","first-page":"541","DOI":"10.1109\/5.24143","article-title":"Petri Nets: Properties, analysis and applications","volume":"77","author":"Murata","year":"1989","journal-title":"Proc. IEEE"},{"key":"ref_42","doi-asserted-by":"crossref","first-page":"58","DOI":"10.1504\/IJSPM.2026.152099","article-title":"Actor-based simulation framework for scalable verification of mutual exclusion algorithms","volume":"23","author":"Nigro","year":"2026","journal-title":"Int. J. Simul. Process Model."}],"container-title":["Computers"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.mdpi.com\/2073-431X\/15\/3\/196\/pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,3,20]],"date-time":"2026-03-20T10:54:55Z","timestamp":1774004095000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.mdpi.com\/2073-431X\/15\/3\/196"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2026,3,20]]},"references-count":42,"journal-issue":{"issue":"3","published-online":{"date-parts":[[2026,3]]}},"alternative-id":["computers15030196"],"URL":"https:\/\/doi.org\/10.3390\/computers15030196","relation":{},"ISSN":["2073-431X"],"issn-type":[{"value":"2073-431X","type":"electronic"}],"subject":[],"published":{"date-parts":[[2026,3,20]]}}}