Local Linearizability for Concurrent Container-Type Data Structures

Andreas Haas, Thomas A. Henzinger, Andreas Holzer, Christoph M. Kirsch, Michael Lippautz, Hannes Payer, Ali Sezgin, Ana Sokolova, Helmut Veith

TL;DR

Linearizability enforces an expensive global real-time ordering across all threads, often strangling the scalability of concurrent data structures. This paper introduces local linearizability, a relaxed consistency model specifically tailored for container-type structures (queues, stacks, and pools) that only requires consistency over the items inserted by each individual thread. Paired with a generic distributed construction (LLD), it yields scalable container implementations achieving up to a 2.77× speedup over the fastest existing linearizable queue.

What Problem Does This Paper Address?

In concurrent programming, correctness is typically defined by linearizability: the illusion that every operation across all threads takes effect instantaneously at a distinct point in real time. While intuitive, linearizability requires heavy cross-thread synchronization, creating severe contention bottlenecks on modern multi-core processors.

Previous attempts to improve performance have mostly relaxed the data structure's sequential specification (e.g., permitting elements in a queue to be dequeued slightly out of order, as in $k$-FIFO queues). The authors address an underexplored alternative: relaxing the consistency condition itself while retaining strict sequential semantics locally. For many real-world systems (like task runtimes, memory allocators, and dispatch queues), an application only cares that a given thread's elements remain ordered relative to each other, not that a single global order is visible to the entire universe.

Methods

  • Local Linearizability (LL): A concurrent execution history $h$ is projected into thread-induced subhistories $h_T$ for each thread $T$. The subhistory $h_T$ contains:
  • All insertions executed by thread $T$.
  • All removals and read operations that retrieve items inserted by $T$ (regardless of which thread performs the removal).
  • Removals that return empty (which act as synchronization barriers).

A history is locally linearizable if every thread-induced subhistory is linearizable against the sequential specification, and these subhistories collectively cover all operations.

  • Generic LLD Architecture: To implement locally linearizable data structures generically, the authors introduce LLD $\Phi$. Given any linearizable base implementation $\Phi$ (e.g., Michael-Scott queue or Treiber stack):
  • Assign each thread its own dedicated backend instance $\Phi_T$, eliminating contention on insertions.
  • When thread $T$ removes an item, it first attempts to pop/dequeue locally from $\Phi_T$.
  • If local removal fails, it eagerly "steals" from other backends starting from a random index.
  • If all backends are empty in a single round, it returns empty.

Datasets

  • Benchmarks: The authors used the open-source Scal concurrent benchmarking framework on synthetic producer-consumer microbenchmarks.
  • Workload Configuration: The benchmark was run with thread counts scaling from 2 to 80 threads (half producers, half consumers), with each thread executing $10^6$ operations separated by a $5\,\mu\text{s}$ busy-wait to avoid artificial contention artifacts.

Key Insights and Ideas

  • Coherence vs. Sequential Consistency Analogy: Just as hardware cache coherence provides sequential consistency per memory location, local linearizability provides linearizability per producing thread.
  • Compositionality: Like linearizability (and unlike sequential consistency), local linearizability is compositional: a collection of concurrent objects is locally linearizable if and only if each object is locally linearizable individually.
  • Strict "Sanity" Guarantees: Despite being weaker than linearizability, LL for pools, queues, and stacks guarantees no duplicated elements, no values invented "out of thin air," and no lost values.
  • No Relaxation in the Single-Thread Case: Unlike $k$-out-of-order data structures, a single-threaded execution on an LL container is guaranteed to strictly match standard sequential behavior.

Key Results

Evaluated on a 40-core (80 hardware threads) Intel Xeon E7-4850 machine:

  • Massive Scaling: Classic data structures that typically collapse under contention beyond 10 threads (such as the Michael-Scott queue and Treiber stack) achieved near-linear scaling up to 80 threads when converted to LLD variants.
  • Outperforming SOTA Linearizable Algorithms:
  • Queues: At 80 threads, the LLD LCRQ reached ~25 million operations/sec, delivering a 2.77× speedup over base LCRQ (the fastest known linearizable queue).
  • Stacks: LLD TS Stack reached ~25.5 million operations/sec, achieving a 2.64× speedup over base TS Stack.
  • Competitive with Pools: LLD queue/stack variants matched or exceeded the throughput of state-of-the-art distributed pool structures (1-RA DQ / 1-RA DS) while providing stronger ordering semantics.

Limitations and Future Work

  • Restricted Data Structure Domain: LL applies specifically to container-type data structures (queues, stacks, pools). It does not directly support associative structures like sets or hash tables, where an insertion also doubles as a global search/membership observation.
  • Emptiness Check Trade-off: Standard LLD does not provide a linearizable emptiness check (though the paper sketches an augmented variant, $\text{LL}^+\text{D}$, that addresses this under certain conditions).
  • Unsuitable for Shared Memory: Local linearizability can cause read values to oscillate between different threads' writes; hence, it is inappropriate as a general shared-memory model.
  • Future Work: Formally establishing the observational refinement guarantees that LL provides to client programs, and extending LL to handle shape observations (e.g., global size queries).

Summary updated

BibTeX
@inproceedings{haas2016local,
  author = {Andreas Haas and Thomas A. Henzinger and Andreas Holzer and Christoph M. Kirsch and Michael Lippautz and Hannes Payer and Ali Sezgin and Ana Sokolova and Helmut Veith},
  title = {{Local Linearizability for Concurrent Container-Type Data Structures}},
  booktitle = {CONCUR},
  year = {2016},
  url = {https://openreview.net/forum?id=r5fwG3k9ph},
}
Figure