Lock-Free Locks Revisited

01/03/2022
by   Naama Ben-David, et al.
0

This paper presents a new and practical approach to lock-free locks based on helping, which allows the user to write code using fine-grained locks, but run it in a lock-free manner. Although lock-free locks have been suggested in the past, they are widely viewed as impractical, have some key limitations, and, as far as we know, have never been implemented. The paper presents some key techniques that make lock-free locks practical and more general. The most important technique is an approach to idempotence – i.e. making code that runs multiple times appear as if it ran once. The idea is based on using a shared log among processes running the same protected code. Importantly, the approach can be library based, requiring very little if any change to standard code – code just needs to use the idempotent versions of memory operations (load, store, LL/SC, allocation, free). We have implemented a C++ library called Flock based on the ideas. Flock allows lock-based data structures to run in either lock-free or blocking (traditional locks) mode. We implemented a variety of tree and list-based data structures with Flock and compare the performance of the lock-free and blocking modes under a variety of workloads. The lock-free mode is almost as fast as blocking mode under almost all workloads, and significantly faster when threads are oversubscribed (more threads than processors). We also compare with several existing lock-based and lock-free alternatives.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
11/14/2018

The Amortized Analysis of a Non-blocking Chromatic Tree

A non-blocking chromatic tree is a type of balanced binary search tree w...
research
12/29/2020

NBR: Neutralization Based Reclamation

Safe memory reclamation (SMR) algorithms suffer from a trade-off between...
research
12/01/2022

Unexpected Scaling in Path Copying Trees

Although a wide variety of handcrafted concurrent data structures have b...
research
01/07/2020

Universal Wait-Free Memory Reclamation

In this paper, we present a universal memory reclamation scheme, Wait-Fr...
research
12/18/2017

Pragmatic Primitives for Non-blocking Data Structures

We define a new set of primitive operations that greatly simplify the im...
research
05/11/2020

What Can Be Done with Consensus Number One: Relaxed Queues and Stacks

Sequentially specified linearizable concurrent data structures must be r...
research
08/10/2021

Fast and Fair Lock-Free Locks

We present a randomized approach for lock-free locks with strong bounds ...

Please sign up or login with your details

Forgot password? Click here to reset