MCSH, a Lock with the Standard Interface
-
Published:2023-06-20
Issue:2
Volume:10
Page:1-23
-
ISSN:2329-4949
-
Container-title:ACM Transactions on Parallel Computing
-
language:en
-
Short-container-title:ACM Trans. Parallel Comput.
Author:
Hesselink Wim H.1ORCID,
Buhr Peter A.2ORCID
Affiliation:
1. University of Groningen, The Netherlands
2. University of Waterloo, Canada
Abstract
The MCS lock of Mellor-Crummey and Scott (1991), 23 pages. is a very efficient first-come first-served mutual-exclusion algorithm that uses the atomic hardware primitives fetch-and-store and compare-and-swap. However, it has the disadvantage that the calling thread must provide a pointer to an allocated record. This additional parameter violates the standard locking interface, which has only the lock as a parameter. Hence, it is impossible to switch to MCS without editing and recompiling an application that uses locks.
This article provides a variation of MCS with the standard interface, which remains FCFS, called MCSH. One key ingredient is to
stack
allocate the necessary record in the
acquire
procedure of the lock, so its life-time only spans the delay to enter a critical section. A second key ingredient is communicating the allocated record between the
acquire
and
release
procedures through the lock to maintain the standard locking interface. Both of these practices are known to practitioners, but our solution combines them in a unique way. Furthermore, when these practices are used in prior papers, their correctness is often argued informally. The correctness of MCSH is verified rigorously with the proof assistant PVS, and experiments are run to compare its performance with MCS and similar locks.
Funder
Natural Sciences and Engineering Research Council of Canada
Publisher
Association for Computing Machinery (ACM)
Subject
Computational Theory and Mathematics,Computer Science Applications,Hardware and Architecture,Modeling and Simulation,Software
Reference25 articles.
1. The existence of refinement mappings
2. M. A. Auslander D. J. Edelsohn O. Y. Krieger B. S. Rosenburg and R. W. Wisniewski. 2003. Enhancement to the MCS lock for increased functionality and improved programmability. U.S. patent application number 20030200457 (abondoned).
3. Peter A. Buhr David Dice and Wim H. Hesselink. 2022. Locking Micro-Benchmarks. Retrieved from https://github.com/pabuhr/concurrent-locking.
4. Fissile Locks
Cited by
1 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. First-Come-First-Served as a Separate Principle;ACM Transactions on Parallel Computing;2024-07-08