Reciprocating Locks

被引:0
作者
Dice, Dave [1 ]
Kogan, Alex [1 ]
机构
[1] Oracle Labs, Burlington, MA 01803 USA
来源
PROCEEDINGS OF THE 2025 THE 30TH ACM SIGPLAN ANNUAL SYMPOSIUM ON PRINCIPLES AND PRACTICE OF PARALLEL PROGRAMMING, PPOPP 2025 | 2025年
关键词
Synchronization; Locks; Mutual Exclusion; Mutex; Scalability; Cache-coherent Shared Memory;
D O I
10.1145/3710848.3710862
中图分类号
TP3 [计算技术、计算机技术];
学科分类号
0812 ;
摘要
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 pthreads, or C++. We show the lock exhibits high throughput under contention and low latency in the uncontended case. Under sustained contention, Reciprocating Locks generate less coherence traffic than MCS and CLH. The performance of Reciprocating Locks is competitive with and often better than the best state-of-the-art scalable queue-based spin locks.
引用
收藏
页码:85 / 98
页数:14
相关论文
共 47 条
[1]   An efficient meta-lock for implementing ubiquitous synchronization [J].
Agesen, O ;
Detlefs, D ;
Garthwaite, A ;
Knippel, R ;
Ramakrishna, YS ;
White, D .
ACM SIGPLAN NOTICES, 1999, 34 (10) :207-222
[2]  
Aksenov V, 2019, Arxiv, DOI arXiv:1904.11323
[3]  
Aksenov Vitaly, 2021, arXiv
[4]  
Anderson J.H., Distributed Computing
[5]  
Anderson James H., 2002, Comput., DOI [10.1007/s00446-002-0084, DOI 10.1007/S00446-002-0084]
[6]  
Anderson T. E., 1990, IEEE Transactions on Parallel and Distributed Systems, V1, P6, DOI 10.1109/71.80120
[7]  
Attiya Hagit, 2008, P 40 ANN ACM S THEOR, DOI 10.1145/
[8]  
Avis D., 1981, UTILITAS MATH, V19, P410
[9]  
Corbet J., 2014, MCS locks and qspinlocks
[10]  
Corbet Jonathan, 2013, A surprise with mutexes and reference counts