Exploring Lamport's Bakery algorithm in C++20
Marton Trencseni - Sun 06 July 2025 • Tagged with lamport, bakery, c++
I explore Lamport’s Bakery algorithm and show how a naive C++20 implementation breaks on weak memory models, how to fix it with std::atomic
, and how to implement bounded tickets.