Locks Must Die: Composable Mutual Exclusion Implemented by Dynamic Resource Sharing on Task Graphs

Locks, the enduring de-facto standard for synchronization in parallel programs, suffer from non-composability and are conducive to a variety of hard-to-find bugs such as data races and deadlocks. In this paper, we propose a straightforward replacement of the traditional lock-based mutex with the Guard, a construct providing mutual exclusion through efficient, dynamic serialization of tasks in a dynamic task graph. Unlike with locks, programming with Guards is lock-free, composable, and immune to deadlock. Guards are compatible with arbitrary executor services, and can be implemented on any platform which supports atomic variables and compare-and-set operations. We will describe the general construction and API for Guards, introduce our reference implementation, and analyze through various benchmarks the performance of our reference implementation against the standard ReentrantLock class used in Java. The practice of writing multithreaded code will benefit from the safety, ease of use, and performance of Guards.

Authors

Institutions

Publication Details

Published
2025-09-15
DOI
https://doi.org/10.1109/escience65000.2025.00035
Primary Topic
Distributed systems and fault tolerance
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Locks Must Die: Composable Mutual Exclusion Implemented by Dynamic Resource Sharing on Task Graphs

Max D. Morris, Hartmut Kaiser, Steven R. Brandt
Distributed systems and fault tolerance
article

Locks Must Die: Composable Mutual Exclusion Implemented by Dynamic Resource Sharing on Task Graphs

Max D. Morris, Hartmut Kaiser, Steven R. Brandt
article en

Abstract

Locks, the enduring de-facto standard for synchronization in parallel programs, suffer from non-composability and are conducive to a variety of hard-to-find bugs such as data races and deadlocks. In this paper, we propose a straightforward replacement of the traditional lock-based mutex with the Guard, a construct providing mutual exclusion through efficient, dynamic serialization of tasks in a dynamic task graph. Unlike with locks, programming with Guards is lock-free, composable, and immune to deadlock. Guards are compatible with arbitrary executor services, and can be implemented on any platform which supports atomic variables and compare-and-set operations. We will describe the general construction and API for Guards, introduce our reference implementation, and analyze through various benchmarks the performance of our reference implementation against the standard ReentrantLock class used in Java. The practice of writing multithreaded code will benefit from the safety, ease of use, and performance of Guards.

Louisiana State University (US)
Openalex Percentile: Top 67%
Distributed systems and fault tolerance
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.