The State-of-the-Art LCRQ Concurrent Queue Algorithm Does NOT Require CAS2
Raed Romanov, Nikita Koval
Abstract
Concurrent queues are, arguably, one of the most important data structures in high-load applications, which require them to be extremely fast and scalable. Achieving these properties is non-trivial. The early solutions, such as the classic queue by Michael and Scott, store elements in a concurrent linked list. Reputedly, this design is non-scalable and memoryinefficient. Modern solutions utilize the Fetch-and-Add instruction to improve the algorithm's scalability and store elements in arrays to reduce the memory pressure. One of the most famous and fast such algorithms is LCRQ. The main disadvantage of its design is that it relies on the atomic CAS2 instruction, which is unavailable in most modern programming languages, such as Java, Kotlin, or Go, let alone some architectures.
This paper presents the LPRQ algorithm, a portable modification of the original LCRQ design that eliminates all CAS2 usages. In contrast, it performs the synchronization utilizing only the standard Compare-and-Swap and Fetch-and-Add atomic instructions. Our experiments show that LPRQ provides the same performance as the classic LCRQ algorithm, outrunning the fastest of the existing solutions that do not use CAS2 by up to 1.6×.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 3c93de7a-bd6e-4e33-88e7-352351eaa99eCited by top-tier papers3
- Aggregating Funnels for Faster Fetch&Add and QueuesYounghun Roh, Yuanhao Wei, Eric Ruppert, Panagiota Fatourou et al.PPoPP 2025 · 2 citations
- Memory Bounds for Concurrent Bounded QueuesVitaly Aksenov, Nikita Koval, Petr Kuznetsov, Anton ParamonovPPoPP 2024 · 1 citation
- Sharded Elimination and Combining for Highly-Efficient Concurrent StacksAjay Singh, Nikos Metaxakis, Panagiota FatourouPPoPP 2026
Builds on1
Related papers
- Fast and Scalable Channels in Kotlin CoroutinesNikita Koval, Dan Alistarh, Roman ElizarovPPoPP 2023 · 12 citations
- CQS: A Formally-Verified Framework for Fair and Abortable SynchronizationNikita Koval, Dmitry Khalanskiy, Dan AlistarhPLDI 2023 · 1 citation
- BBQ: A Block-based Bounded Queue for Exchanging Data and ProfilingJiawei Wang, Diogo Behrens, Ming Fu, Lilith Oberhauser et al.USENIX ATC 2022
- Reciprocating LocksDave Dice, Alex KoganPPoPP 2025 · 1 citation
- No Rush in Executing Atomic InstructionsAshkan Asgharzadeh, Josué Feliu, Manuel E. Acacio, Stefanos Kaxiras et al.HPCA 2025
