The Author(s) © 2017. This article is published with open access at Springerlink.com
Formal Aspects of Computing (2017) 29: 833-852
Tournaments for mutual exclusion: veriﬁcation
and concurrent complexity
Wim H. Hesselink
Johann Bernoulli Institute for Mathematics and Computer Science University of Groningen,
P.O.Box 407, 9700 AK Groningen, The Netherlands
Abstract. Given a mutual exclusion algorithm MXd for d ≥ 2 threads, a mutual exclusion algorithm for N > d
threads can be built in a tree of degree d with N leaves, with the critical section at the root of the tree. This
tournament solution seems obviously correct and efﬁcient. The present note proves the correctness, and formalizes
the efﬁciency in terms of concurrent complexity by means of Bounded Unity. If the tree is balanced, the throughput
is logarithmic in N . If moreover MXd satisﬁes FCFS (ﬁrst-come ﬁrst-served), the worst case individual delay of
the tournament algorithm is of order N . This is optimal.
Keywords: Mutual exclusion,
, Concurrency, Shared variables, Concurrent complexity
The problem of mutual exclusion for N threads or processes was proposed by Dijkstra [Dij65] in 1965. His
solution was improved by Knuth [Knu66] and De Bruijn [dB67]. In 1974, Lamport [Lam74] proposed his Bakery
Algorithm. In all these solutions, the competing threads inspected the intentions of the other threads by reading
an array of size N . In 1977, Peterson and Fischer [PF77] proposed the ﬁrst tournament solution, in which a
competing thread need not inspect the intentions of all other threads.
In general, a tournament solution of mutual exclusion for N threads is based on an auxiliary solution MXd
for d ≥ 2 threads, where d is a small number, usually d 2. One constructs a tree with N leaves in which every
internal node has at most d children. Initially, the threads are located in the leaves of the tree. In order to reach the
critical section, a thread repeatedly performs the entry protocol of MXd in competition with the threads located
in the siblings of its current node. Each time it completes an entry protocol, the thread moves to the parent of
its current node. When it reaches the root of the tree, it has access to the critical section. After this, the thread
moves back along its root path to execute the exit protocols of MXd.
Recent experiments of Buhr et al. [BDH15, BDH16] show that tournament algorithms for mutual exclusion
can perform almost as good as the hardware assisted MCS algorithm of Mellor-Crummey and Scott [MCS91].
The challenge for the present paper is to complement this experimental result with a theoretical estimate of the
concurrent complexity of tournament algorithms, and to see how this depends on the choice of MXd.
Correspondence and offprint requests to: W. H. Hesselink, E-mail: firstname.lastname@example.org