Skip to main content
QUICK REVIEW

[Paper Review] LL/SC and Atomic Copy: Constant Time, Space Efficient Implementations using only pointer-width CAS

Guy E. Blelloch, Yuanhao Wei|arXiv (Cornell University)|Nov 21, 2019
Distributed systems and fault toleranceComputer Science7 citations
TL;DR

This paper presents a constant-time, space-efficient implementation of M Load-Link/Store-Conditional (LL/SC) objects using only pointer-sized CAS operations, achieving Θ(M + kP²) space complexity, where k is the maximum number of overlapping LL/SC operations per process. It introduces a novel primitive called Single-Writer Copy, which atomically copies a word-sized value to a destination with exclusive write access, enabling efficient and correct concurrent algorithms without unbounded sequence numbers or excessive space overhead.

ABSTRACT

When designing concurrent algorithms, Load-Link/Store-Conditional (LL/SC) is often the ideal primitive to have because unlike Compare and Swap (CAS), LL/SC is immune to the ABA problem. However, the full semantics of LL/SC are not supported by any modern machine, so there has been a significant amount of work on simulations of LL/SC using Compare and Swap (CAS), a synchronization primitive that enjoys widespread hardware support. All of the algorithms so far that are constant time either use unbounded sequence numbers (and thus base objects of unbounded size), or require $\Omega(MP)$ space for $M$ LL/SC object (where $P$ is the number of processes). We present a constant time implementation of $M$ LL/SC objects using $\Theta(M+kP^2)$ space, where $k$ is the maximum number of overlapping LL/SC operations per process (usually a constant), and requiring only pointer-sized CAS objects. Our implementation can also be used to implement $L$-word $LL/SC$ objects in $\Theta(L)$ time (for both $LL$ and $SC$) and $\Theta((M+kP^2)L)$ space. To achieve these bounds, we begin by implementing a new primitive called Single-Writer Copy which takes a pointer to a word sized memory location and atomically copies its contents into another object. The restriction is that only one process is allowed to write/copy into the destination object at a time. We believe this primitive will be very useful in designing other concurrent algorithms as well.

Motivation & Objective

  • To address the lack of hardware support for full LL/SC semantics in modern architectures despite its advantages over CAS.
  • To design a constant-time implementation of M LL/SC objects that avoids unbounded sequence numbers and excessive space usage.
  • To reduce space complexity from Ω(MP) to Θ(M + kP²) while using only pointer-sized CAS operations.
  • To introduce and formalize the Single-Writer Copy primitive as a reusable atomic building block for concurrent algorithms.

Proposed method

  • Designing a new atomic primitive called Single-Writer Copy, which allows a single process to atomically copy a word-sized value to a destination object.
  • Using pointer-sized CAS operations to implement the Single-Writer Copy primitive without requiring larger-than-pointer-sized atomic operations.
  • Constructing M LL/SC objects by composing the Single-Writer Copy primitive with other CAS-based synchronization techniques.
  • Ensuring correctness under concurrent access by enforcing exclusive write semantics on the destination of the copy operation.
  • Extending the construction to support L-word LL/SC objects with Θ(L) time complexity and Θ((M + kP²)L) space.
  • Proving that the algorithm achieves constant-time operations (LL and SC) and optimal space bounds under the given constraints.

Experimental results

Research questions

  • RQ1Can LL/SC objects be implemented in constant time using only pointer-sized CAS operations?
  • RQ2Is it possible to achieve sub-quadratic space complexity in terms of the number of processes P, without relying on unbounded sequence numbers?
  • RQ3Can a new atomic primitive be designed that enables efficient and correct concurrent copying with single-writer semantics?
  • RQ4How can the space complexity of LL/SC simulations be reduced from Ω(MP) to Θ(M + kP²)?
  • RQ5What is the performance and space trade-off when extending the implementation to multi-word LL/SC objects?

Key findings

  • The proposed algorithm achieves constant-time LL and SC operations, matching the performance of native LL/SC instructions.
  • The space complexity is Θ(M + kP²), significantly improving upon the Ω(MP) bound of prior constant-time algorithms.
  • The algorithm uses only pointer-sized CAS operations, making it implementable on all modern hardware with CAS support.
  • The introduction of the Single-Writer Copy primitive enables a clean and modular construction of LL/SC objects with strong correctness guarantees.
  • The method generalizes to L-word LL/SC objects with Θ(L) time and Θ((M + kP²)L) space, preserving constant-time semantics.
  • The approach avoids unbounded sequence numbers, eliminating the need for objects of unbounded size.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.