A Scalable, Portable, and Memory-Efficient Lock-Free FIFO Queue

Ruslan Nikolaev
8/13/2019
cs.DC

Official code: rusnikola/lfqueue (76 stars, C, last commit 2026-09-25).

Abstract

We present a new lock-free multiple-producer and multiple-consumer (MPMC) FIFO queue design which is scalable and, unlike existing high-performant queues, very memory efficient. Moreover, the design is ABA safe and does not require any external memory allocators or safe memory reclamation techniques, typically needed by other scalable designs.

Show full abstract

In fact, this queue itself can be leveraged for object allocation and reclamation, as in data pools. We use FAA (fetch-and-add), a specialized and more scalable than CAS (compare-and-set) instruction, on the most contended hot spots of the algorithm. However, unlike prior attempts with FAA, our queue is both lock-free and linearizable. We propose a general approach, SCQ, for bounded queues. This approach can easily be extended to support unbounded FIFO queues which can store an arbitrary number of elements. SCQ is portable across virtually all existing architectures and flexible enough for a wide variety of uses. We measure the performance of our algorithm on the x86-64 and PowerPC architectures. Our evaluation validates that our queue has exceptional memory efficiency compared to other algorithms and its performance is often comparable to, or exceeding that of state-of-the-art scalable algorithms.

View on arXivView PDF

Code Implementations(1)

rusnikola/lfqueueOfficial100%

A Scalable, Portable, and Memory-Efficient Lock-Free FIFO Queue (DISC '19)

769C, ShellOct 22, 20192 months ago

Similar Papers

Cite this paper

@article{nikolaev2019scalable,
  title  = {A Scalable, Portable, and Memory-Efficient Lock-Free FIFO Queue},
  author = {Ruslan Nikolaev},
  year   = {2019},
  eprint = {1908.04511},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1908.04511}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1908.04511.svg)](https://codeofpaper.com/paper/1908.04511)

Discussion