# Mutable Locks: Combining the Best of Spin and Sleep Locks

**Authors:** Romolo Marotta, Davide Tiriticco, Pierangelo Di Sanzo, Alessandro, Pellegrini, Bruno Ciciani, Francesco Quaglia

arXiv: 1906.00490 · 2023-06-02

## TL;DR

Mutable Locks offer a self-tuning synchronization mechanism that adaptively balances responsiveness and CPU usage, optimizing performance in multi-core environments without requiring manual tuning.

## Contribution

Introduction of Mutable Locks, a hybrid lock that self-tunes between spin and sleep modes for improved efficiency in diverse workloads.

## Key findings

- Self-tuning reduces CPU usage during waits.
- Responsive access after critical sections is maintained.
- Applicable in generic concurrent applications without workload knowledge.

## Abstract

In this article we present Mutable Locks, a synchronization construct with the same execution semantic of traditional locks (such as spin locks or sleep locks), but with a self-tuned optimized trade off between responsiveness---in the access to a just released critical section---and CPU-time usage during threads' wait phases. It tackles the need for modern synchronization supports, in the era of multi-core machines, whose runtime behavior should be optimized along multiple dimensions (performance vs resource consumption) with no intervention by the application programmer. Our proposal is intended for exploitation in generic concurrent applications where scarce or none knowledge is available about the underlying software/hardware stack and the actual workload, an adverse scenario for static choices between spinning and sleeping faced by mutable locks just thanks to their hybrid waiting phases and self-tuning capabilities.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1906.00490/full.md

## Figures

20 figures with captions in the complete paper: https://tomesphere.com/paper/1906.00490/full.md

## References

15 references — full list in the complete paper: https://tomesphere.com/paper/1906.00490/full.md

---
Source: https://tomesphere.com/paper/1906.00490