Reciprocating Locks

📅 2025-01-04
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
To address high latency, low throughput, and starvation risks of mutex locks in cache-coherent shared-memory systems, this paper proposes a novel scalable mutex algorithm. Its core innovation is a pioneering round-trip synchronization mechanism, enabling constant-time lock acquisition and release for the first time. The design employs per-thread single-element local spinning, lightweight state encoding, and lock-free metadata management—achieving strong starvation-freedom while supporting bounded bypass. The lock incurs only constant-space overhead, and a single waiting unit can manage multiple held locks. Experimental results show significantly higher throughput than state-of-the-art scalable spinlocks (e.g., MCS, CLH) under high contention, and near-hardware-atomic-instruction latency in the uncontended case. The algorithm has been successfully integrated into the Linux kernel, POSIX threads (pthreads), and the C++ standard library, demonstrating practicality and broad compatibility.

Technology Category

Application Category

📝 Abstract
We present"Reciprocating Locks", a novel mutual exclusion locking algorithm, targeting cache-coherent shared memory (CC), that enjoys a number of desirable properties. The doorway arrival phase and the release operation both run in constant-time. Waiting threads use local spinning and only a single waiting element is required per thread, regardless of the number of locks a thread might hold at a given time. While our lock does not provide strict FIFO admission, it bounds bypass and has strong anti-starvation properties. The lock is compact, space efficient, and has been intentionally designed to be readily usable in real-world general purpose computing environments such as the linux kernel, pthreads, or C++. We show the lock exhibits high throughput under contention and low latency in the uncontended case. The performance of Reciprocating Locks is competitive with and often better than the best state-of-the-art scalable spin locks.
Problem

Research questions and friction points this paper is trying to address.

Mutual Exclusion
Cache-Coherent Shared Memory Systems
Efficient Locking Algorithm
Innovation

Methods, ideas, or system contributions that make the work stand out.

Reciprocating Locks
constant-time operations
anti-starvation properties
🔎 Similar Papers
No similar papers found.