Efficient Multi-word Compare and Swap

08/06/2020
by   Rachid Guerraoui, et al.
0

Atomic lock-free multi-word compare-and-swap (MCAS) is a powerful tool for designing concurrent algorithms. Yet, its widespread usage has been limited because lock-free implementations of MCAS make heavy use of expensive compare-and-swap (CAS) instructions. Existing MCAS implementations indeed use at least 2k+1 CASes per k-CAS. This leads to the natural desire to minimize the number of CASes required to implement MCAS. We first prove in this paper that it is impossible to "pack" the information required to perform a k-word CAS (k-CAS) in less than k locations to be CASed. Then we present the first algorithm that requires k+1 CASes per call to k-CAS in the common uncontended case. We implement our algorithm and show that it outperforms a state-of-the-art baseline in a variety of benchmarks in most considered workloads. We also present a durably linearizable (persistent memory friendly) version of our MCAS algorithm using only 2 persistence fences per call, while still only requiring k+1 CASes per k-CAS.

READ FULL TEXT

page 8

page 9

page 23

page 24

research
09/11/2023

The Fence Complexity of Persistent Sets

We study the psync complexity of concurrent sets in the non-volatile sha...
research
07/07/2021

Persistent Software Combining

We study the performance power of software combining in designing persis...
research
10/31/2022

EEMARQ: Efficient Lock-Free Range Queries with Memory Reclamation

Multi-Version Concurrency Control (MVCC) is a common mechanism for achie...
research
12/23/2020

Flat-Combining-Based Persistent Data Structures for Non-Volatile Memory

Flat combining (FC) is a synchronization paradigm in which a single thre...
research
12/31/2021

Elimination (a,b)-trees with fast, durable updates

Many concurrent dictionary implementations are designed and optimized fo...
research
08/28/2019

Strongly Linearizable Implementations of Snapshots and Other Types

Linearizability is the gold standard of correctness conditions for share...
research
12/16/2022

Implementation of general formal translators

The general translator formalism and computing specific implementations ...

Please sign up or login with your details

Forgot password? Click here to reset