Abstract

The MCS lock was the first mutual exclusion lock to support an arbitrary number of processes with unknown identities such that each process can acquire and release the lock in a constant number of RMRs on both Cache-Coherent and Distributed Shared Memory multiprocessors. The MCS algorithm, however, has a shortcoming: its Exit section is not bounded. The algorithm also requires hardware support for more than one special instruction, namely, Fetch&Store and Compare&Swap. Many MCS-style algorithms were subsequently designed to overcome these shortcomings, but to the best of our knowledge they either lack some desirable property of the MCS lock or introduce a new shortcoming. In this paper we present a new MCS-style algorithm that has all of the desirable properties and no ostensible shortcoming. We also provide a rigorous, invariant-based proof of correctness. To realize a bounded Exit section, all prior MCS-style algorithms use either the or the strategy. Our work unifies these two strategies: we present a single algorithm which, when appropriately instantiated, yields both a node-switching and a node-toggling algorithm. Moreover, the two algorithms so derived are the simplest in their respective classes among all known MCS-style algorithms.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call