An O(1) RMRs Leader Election Algorithm Wojciech Golab Danny Hendler Philipp Woelfel § Department of Department of Department of Computer Science Computer Science Computer Science University of Toronto Ben-Gurion University University of Toronto Canada Israel Canada wgolab@cs.toronto.edu hendlerd@cs.bgu.ac.il pwoelfel@cs.toronto.edu January 6, 2010 Abstract The leader election problem is a fundamental coordination problem. We present leader election algorithms for multiprocessor systems where processes communicate by reading and writing shared memory asynchronously, and do not fail. In particular, we consider the cache- coherent (CC) and distributed shared memory (DSM) models of such systems. We present leader election algorithms that perform a constant number of remote memory references (RMRs) in the worst case. Our algorithms use splitter-like objects [6, 9] in a novel way, by organizing active processes into teams that share work. As there is an Ω(log n) lower bound on the RMR complexity of mutual exclusion for n processes using reads and writes only [10], our result separates the mutual exclusion and leader election problems in terms of RMR complexity in both the CC and DSM models. Our result also implies that any algorithm using reads, writes and one-time test-and-set objects can be simulated by an algorithm using reads and writes with only a constant blowup of the RMR complexity; proving this is easy in the CC model, but presents subtle challenges in A preliminary version of this paper appeared in [16]. Supported in part by the Natural Sciences and Engineering Research Council (NSERC) of Canada. Part of this work was done while the second author was a postdoc fellow in the University of Toronto and the Technion. Supported in part by the Technion’s Aly Kaufman Fellowship. § Supported by DFG grant WO1232/1-1. 1