An Almost-Logarithmic Lower Bound for Leader Election with Bounded Value Contention
Abstract
We investigate the step complexity of the Leader Election problem (and implementing the corresponding test-and-set object) in asynchronous shared memory, where processes communicate through registers supporting atomic read and write and must coordinate so that a single process becomes the leader. Determining tight step complexity bounds for solving this problem is one of the key open problems in the theory of shared memory distributed computing. The best known algorithm is a randomized tournament-tree, which has worst-case expected step complexity for processes. There are provably no deterministic wait-free algorithms, and only restricted lower bounds are known for obstruction-free and randomized wait-free algorithms. We introduce a new lower bound that establishes an step complexity for any obstruction-free Leader Election algorithm, where is the number of processes, and is a bound on the value contention, which we define as the maximum number of different values that processes can be simultaneously poised to write to the same register in any execution of the algorithm. Our result is strictly stronger than previous bounds based on write contention. In particular, it implies new lower bounds on step complexity that depend on register size.
Keywords and phrases:
Leader Election, Test-and-Set, Shared Memory, Lower BoundsCopyright and License:
2012 ACM Subject Classification:
Theory of computation Shared memory algorithms ; Theory of computation Lower bounds and information complexity ; Theory of computation ConcurrencyAcknowledgements:
The authors would like to thank the DISC 2025 anonymous reviewers for their detailed comments and, in particular, Reviewer C, who inspired our approach for a new and simpler proof of Theorem 5 via the probabilistic method.Funding:
The work of Dan Alistarh is supported by grants from ERC, Austrian FWF, and the Google and NVIDIA corporations. Faith Ellen was supported in part by the Natural Science and Engineering Research Council of Canada (NSERC) grant RGPIN-2020-04178.Editor:
Dariusz R. KowalskiSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
Leader Election is a fundamental coordination problem in distributed computing, in which, as the name suggests, a set of processes compete to become the leader. Each process should output either win or lose, indicating whether the process became the leader. At most one process should become the leader and, if all processes that compete take enough steps, then exactly one of these processes becomes the leader. Note that it is not required for other processes to know the identity of the leader, as this would make the problem equivalent to Consensus, which is known to be a harder coordination problem.
A closely-related problem is implementing a test-and-set object. It differs from Leader Election in that no process may return lose before the eventual winner has started the computation. However, any Leader Election algorithm can be deterministically transformed into an implementation of a test-and-set object with just one additional register and at most two additional steps by each process [4].
Leader Election and test-and-set objects have been studied with different formulations and in various models for almost four decades, e.g. [25, 28, 2, 12, 5]. In this paper, we will focus on Leader Election in the asynchronous shared memory model [22, 9], where processes can communicate only through registers, shared objects that support read and write operations. Read returns the value stored in the register, while a write atomically update the stored value. In this way, one process can learn about another process if it reads a register that was last written to by that process. A process executes reads and writes on arbitrary registers one by one, but the way in which the operations of a process are interleaved with those of other processes is controlled by an adversary. Specifically, it is assumed that the adversary decides the order of the steps, with the goal of making processes execute as many steps as possible. It is known that a test-and-set object has consensus number two. Thus, it has no deterministic wait-free implementation from registers [17].
1.1 Prior Work
The first randomized algorithm for Leader Election among two processes was given by Tromp and Vitányi [26]. The approach was later generalized to processes by Afek, Gafni, Tromp and Vitányi [1] using a tournament tree [24], in which each process starts at a leaf of the tree. At each node, the process competes in an instance of Leader Election among two processes. If it loses, it immediately returns lose. If it wins, it continues to the parent node. The winner at the root can return win. This algorithm has worst-case expected step complexity, since each instance of Leader Election among two processes takes an expected constant number of steps and the tournament tree has depth. This can be straightforwardly modified to an obstruction-free variant with logarithmic solo step complexity [5].
The approach described above leads to the best known upper bound for the case of a strong adversary. Whether this upper bound is optimal remains an open problem [15]. Later work extended these results to the adaptive setting, where the step complexity depends on the number of participating processes, . Specifically, Alistarh, Attiya, Gilbert, Giurgiu, and Guerraoui proposed the RatRace algorithm which achieves step complexity in expectation [4, 14]. Golab, Hendler and Woelfel designed an algorithm that solves Leader Election in remote memory accesses [16]. However, their algorithm is not obstruction-free: if a process crashes, this may cause another process to wait forever for the value in a register to change.
Remarkably, despite decades of interest in the relationship between upper and lower bounds for Leader Election in shared memory, we still do not know whether the logarithmic upper bound is tight, neither for the expected step complexity of randomized algorithms against a strong adversary, nor for the solo step complexity of deterministic obstruction-free algorithms. Intuitively, proving lower bounds for test-and-set is hard because of the apparent simplicity of the object.
The list of relevant lower bounds for Leader Election against a strong adversary is shown in Table 1. In 1989, Styer and Peterson proved that any Leader Election algorithm has to use registers [25]. This space complexity lower bound was later matched by an obstruction-free Leader Election algorithm that uses registers [13]. The remaining lower bounds, including ours, build on ideas from the lower bounds for mutual exclusion established by James H. Anderson and Yong-Jik Kim [7]. They proved an step complexity lower bound for Mutual Exclusion by inductively constructing an execution. Their analysis distinguishes between two scenarios: the high-contention and the low-contention cases. In the low-contention case, they apply a graph theory result to find a large set of processes that do not conflict with one another and use them to extend their execution. In the high-contention case, they run some processes until they enter and leave the critical section, thereby overwriting the contents of the highly contended registers.
The first work to apply Anderson and Kim’s ideas to Leader Election was by Alistarh, Gelashvili, and Nadiradze [5]. They proved that any algorithm has worst-case expected step complexity , where is the maximum write contention. However, this lower bound becomes trivial when polynomially many processes can write to the same register, that is, when , for some constant . In other related work, Eghbali and Woefel proved an lower bound for implementing an Abortable Test-And-Set object [10]. They use a different model, which counts the maximum number of remote memory references (RMRs) performed by a process, rather than the maximum number of steps. However, their proof still follows Anderson and Kim’s framework. To handle the high-contention case, their proof heavily relies on the fact that processes can be aborted after they overwrite some register. Thus, their results apply only to Abortable Leader Election, and not to our model.
1.2 Contribution
In this paper, we present a new technique that leads to a lower bound for Leader Election under a more general notion of contention, which we call value contention. Specifically, we show a lower bound of on the solo step complexity of any obstruction-free Leader Election algorithm for processes, where is an upper bound on the value contention, that is, the number of different values that processes can be simultaneously poised to write to the same register in any execution.
This result leads to a new trade-off between the maximum register capacity and the solo step complexity of test-and-set: for instance, if registers can only hold a poly-logarithmic number of different values, then test-and-set requires steps in a solo execution, in the worst-case. Similarly, if at most processes may be simultaneously poised to write to the same register, we obtain the lower bound of Alistarh, Gelashvili and Nadiradze [5], but via new argument. Put differently, our proof shows that constant-time algorithms for test-and-set are only possible if, for some constant , processes can concurrently be poised to write different values to the same register. Furthermore, our lower bound shows that no adaptive Leader Election algorithm is possible, unless registers can hold polynomial in many values, and polynomial in processes can be poised to write different values to the same register at the same time. We say that an algorithm is adaptive if its step complexity depends only on the actual number of participating processes and not on the total number of processes in the system.
Our lower bound is based on a technique that generalizes the knowledge-based approach of Anderson and Kim [7]. At a high level, we inductively construct a sequence of executions in which no active process sees any other active process. Specifically, this leads to an execution by one process in which it takes steps. In each round of the execution, active processes perform one additional read or write. Thus, by round , each has taken steps. We split these active processes into groups, called factions, depending on the step they are about to perform. We then proceed to schedule the processes adversarially, to minimize the information flow between them. Since information flow may arise from values written to registers in previous rounds, we also erase some processes, or even entire factions, from the execution. To determine which active processes should continue to the next round, we build a conflict graph, where an edge exists between two processes if executing them both would create information flow, or if the two processes are poised to write different values to the same register simultaneously.
So far, this construction is similar to step complexity lower bound proofs for low contention [7, 10, 5]. The key new observation is that we can adjust the execution so that the conflict graph can be represented by a new, special kind of structure that we call a faction graph. Roughly, a faction graph can be partitioned into sets of vertices with super-edges from vertices to parts of the partition. Intuitively, this allows us to generate a compact representation for any conflict graph. Our main technical lemma is a lower bound of on the maximum size of an independent set in any conflict graph represented by a faction graph with vertices and multi-edges. This lemma may be of separate interest for other problems that can be described using faction graphs.
Our lower bound argument combines the fact that the conflict graph at each round can be represented by a faction graph, with our technical lemma about such graphs to obtain a new lower bound of on the number of processes that survive until the round. These processes do not see one another. We can continue, while keeping at least one process active, for rounds.
The paper by Alistarh, Gelashvili and Nadiradze [5] presents a complex, potential-based covering argument leading to a lower bound of that depends on step contention . In a follow-up online revision [6], the authors provided a simpler argument, which carefully re-works the original Anderson and Kim lower bound to obtain a simpler proof of the same lower bound. Our lower bound proves a slightly weaker result in the bounded step contention case. Our focus is on the bounded value contention case, which is a generalization of the case when registers have bounded size.
On the upper bound side, we observe that the tournament tree algorithm by Afek, Gafni, Tromp and Vitányi [1] has constant bounded value contention . In fact, with slight modifications, it uses only single-bit registers, and thus has value contention . Therefore, our lower bound almost matches the upper bound. Moreover, even though there are adaptive Leader Election algorithms with step complexity [4, 14] (where is the number of participating processes), our main lower bound implies that adaptive Leader Election is impossible unless for some constant . In other words, we prove that any algorithm for adaptive Leader Election must use registers of logarithmic size and has executions where the number of processes simultaneously poised to write different values to the same register is polynomial in .
2 Preliminaries
We consider an asynchronous distributed system where a set of processes, , communicate through a set of registers that can be read from and written to by any process. A step is a read of a specific register or a write of a specific value to a specific register performed by one process, followed by an update of the state of the process, including any local coin flips it wishes to perform.
An execution is a sequence of steps of processes in the system, starting from the initial configuration. An execution is -only if it only contains steps performed by processes in . If is a prefix of execution , we say that extends . A process is poised to write to a register at the end of an execution if, in every execution that extends and in which performs more steps, ’s next step after is writing to . An execution is terminating if all operations (that have begun) have finished. A round-by-round execution is an execution in which, for every positive integer , all processes that take at least steps do so before any process takes its ’st step. The ’th round of the execution is a consecutive sequence of steps by different processes, each of which has previously taken steps. Thus, a round-by-round execution is a concatenation of rounds.
The step complexity of an execution is the maximum number of steps performed by one process. The step complexity of an algorithm is the maximum step complexity of any execution of the algorithm. The solo step complexity of an algorithm is the maximum number of steps in any solo execution of the algorithm, i.e., in which only one process takes steps. The total step complexity of an algorithm is the maximum number of steps in any execution of the algorithm.
Adversary.
This paper assumes the strong (adaptive) adversary model. In this model, the order in which processes take steps is decided adaptively by an adversary. It knows everything about the current state of all processes when it chooses which process takes the next step. By comparison, weaker adversaries have only partial information about process states such as the outcomes of random coin flips [3, 14]. To be specific, our lower bound proofs assume that the adversary knows the next step of every process, but does not need other information about internal process states.
Worst-case expected step complexity.
Consider a (possibly randomized) algorithm and an adaptive adversary , which we assume, for simplicity, to be deterministic. Let be the random variable denoting the number of steps process performs in the execution of when the scheduling is done by the adversary . The expected step complexity of an execution under is , where the expectation is taken over the processors’ coin flips. The worst-case expected step complexity of algorithm is , i.e. the supremum over the expected step complexity of , under any adversary.
Leader Election.
A Leader Election algorithm supports a single operation, elect, which each process may perform at most once. This operation returns either win or lose indicating whether the process won the election. It satisfies the following properties:
-
With probability , every process that does not crash finishes its operation in a finite number of steps.
-
At most one operation returns win.
-
If all operations that started have finished, then exactly one operation returned win.
Splitter.
A Splitter [21, 23] is an object that supports a single operation, decide, which each process may perform at most once. It satisfies the following properties:
-
The output of decide is either Stop, Left, or Right.
-
Every process that calls decide finishes it within a finite number of steps.
-
At most one process can get Stop.
-
If only one process calls decide, then it is guaranteed to get Stop.
-
If more than one process calls decide, then not all processes get the same output.
Instead of the last property, a Randomized Splitter [8] requires that the probability a call of decide returns Left is the same as the probability it returns Right, independent of all other calls. Splitter and Randomized Splitter objects are similar to Leader Election, where getting Stop as output is analogous to winning, but they do not guarantee that some process gets output Stop, even if all calls have terminated.
Process Visibility.
We say that process sees another process if reads a value from some register that differs from the last value wrote there or is not the initial value of the register, if never wrote there. We say that sees process if was the last process that wrote to that register before read it. For any execution , define if sees or sees in execution . Let be the reflexive transitive closure of . This is an equivalence relation. A set of processes is closed (with respect to ) if there does not exist and such that .
Note that, if is a set of processes that is closed with respect to , then erasing the steps of all processes in from results in an execution. Since exactly one operation wins in every terminating execution of Leader Election, we get the following result.
Lemma 1.
Let be an execution of a Leader Election algorithm and let be a nonempty set of processes that is closed with respect to . Let be an execution obtained by erasing the steps of all processes in from and then running all processes in until they each finish performing elect. Then exactly one process in wins in .
Based on this lemma, we formulate the first commonly used idea guaranteeing that processes have to take more steps in an execution of Leader Election that contains at least two processes that are not related by .
Lemma 2.
Let be an execution of a Leader Election algorithm. Consider a partition of into sets that are closed with respect to . Then every set, except possibly one, contains at least one process that has not finished performing elect.
Proof.
For every part, , of the partition, there is an execution obtained by erasing the steps of all processes in from and then running all processes in until they each finish performing elect(). By Lemma 1, exactly one process in wins in this execution. Consider the winning process for each set in the partition. Since at most one process wins in , each of these processes, except possibly one, has not won in and, thus, it has not finished performing elect.
Intuitively, Lemma 2 shows that, if we execute processes in a way that prevents them from learning about one another, we can ensure that they have to take more steps.
3 Independent Set Lower Bound for Faction Graphs
In this section, we describe our main combinatorial result, which we later use to prove our main lower bound. It is a stronger, specialized version of Turán’s Theorem [27]:
Theorem 3.
Every graph contains an independent set of size at least .
We prove that any graph that can be represented in a special form, which we call a faction graph, has a sufficiently large independent set.
Faction Graphs.
A faction graph is defined by a partition, , of its vertex set, , and a set of super-edges, , which connects vertices to parts of the partition, called factions. It contains no edges from any vertex to the faction that contains it. The graph represented by is an undirected graph with the property that, if a vertex has a super-edge in to a faction, , then all vertices in are neighbors of in . An example of a faction graph is shown in Figure 1(a). The formal definition is given below.
Definition 4.
is a faction graph if is a set of vertices, is a partition of , and such that for all . The graph represented by this faction graph is , where .
Generally, a faction graph is a much more compact representation of the graph it represents.
Figure 1(a) is a faction graph with 7 vertices, 3 factions, , , and , and 3 super-edges. Figure 1(b) is the graph it represents. The super-edge is expanded into the two edges and .
Independent Sets in Faction Graphs.
We will show, using the probabilistic method, that the graph represented by a faction graph has an independent set of size . This is similar to Turán’s theorem (Theorem 3). Our key observation is that we can obtain a much bigger lower bound on the size of an independent set, since can be asymptotically much smaller than .
Theorem 5.
The graph represented by a faction graph contains an independent set of size at least
Proof.
Let and . If , then , so is an independent set of of size . Therefore, assume .
Since there are no edges in between two nodes in the same faction, every faction is an independent set. For each vertex , let be the faction that contains and let
By definition, . Observe that
since every super-edge contributes exactly once to the sum.
We use the probabilistic method. Select each faction , independently, with some fixed probability , obtaining a random subset . From build a random vertex set
consisting of every vertex whose faction was selected, but has no super-edge to any selected faction.
First, we show that is an independent set of . Consider any two vertices, . If , then , since every faction is an independent set. So suppose . By definition of , , so and . Hence . By Definition 4, it follows the .
Next, we get a lower bound on the expected size of . For any fixed , the event that is independent of the event that . Therefore
The function is convex for . By Jensen’s inequality [18],
Hence , where .
We now choose a good value for . Consider the function on the interval . Since its derivative is , it follows that is maximized when . Using this value of gives
Since for , we have
Hence
Because is an independent set for every choice of , it follows that contains an independent set of at least this size.
4 The Leader Election Lower Bound
With these preliminaries in place, we now present a new step complexity lower bound for the Leader Election problem (and implementing a test-and-set object) in asynchronous shared memory. To date, no non-trivial lower bound on step complexity for implementing a test-and-set object that depends only on is known. Our lower bound is no exception: It assumes bounded value contention , defined as follows.
Definition 6 (Bounded Value Contention).
An algorithm has bounded value contention if, at all points during an execution, processes can be poised to write at most different values to the same register.
Discussion.
We note that bounded value contention is strictly more general than both write contention and register size. In particular, bounded write contention implies value contention at most . However, the reverse does not hold because we can allow arbitrary many processes be simultaneously poised to write the same value to a register, without exceeding the value contention bound. Likewise, an upper bound, , on the number of different values that can be written to a register (which is equivalent to a bound on register size) implies value contention at most . Again, the reverse does not hold, since arbitrarily many different values can be poised to be written to a register in different executions, or at different configurations during the same execution without exceeding the value contention bound.
To see the intuition why we need this additional restriction on the algorithm to obtain a non-trivial lower bound, consider the following pseudocode:
Here, each process first writes its id to a shared register, door, and then reads this register. If it reads the id of another process, it immediately loses. Observe that we can add this code at the beginning of any Leader Election algorithm, since the last process to write to door will continue to the next part of the algorithm, if it does not crash. The previous step complexity lower bound proofs construct a worst-case execution by repeatedly selecting a set of processes that each perform one more step, one after the other [5, 10, 7]. However, in an execution that begins with a round in which every process takes one step, there is only one process that does not lose when it performs its second step. Consequently, this process will execute the next part of the algorithm by itself. For some algorithms, for example, one that uses a Splitter, this process will also terminate within a constant number of steps. However, in an execution in which no process writes to door between the write to door and subsequent read of door by the same process, all non-faulty processes reach the next part of the algorithm. Our bounded value contention does not allow all processes to be simultaneously poised to write their ids to the same register, so such an algorithm does not contradict our lower bound.
The main result of this section is the following:
Theorem 7.
For any obstruction-free Leader Election algorithm for processes with value contention , there exists a solo execution of length .
Proof.
We begin by giving an overview of the proof approach. We will construct a round-by-round execution, one round at a time. In each round, we have a set of active processes that each takes one additional step. We maintain the invariant that the processes do not see one another. In other words, for each active process, the execution is indistinguishable from a solo execution. Initially, all processes are active and the execution is empty.
To add an additional round, we consider the next step of all active processes and partition them into groups depending on what register they access, whether they read or write, and what value they read or what value they write. After that, we construct a conflict graph, where the nodes are the active processes and there is an edge between two processes if one of them sees the other in any extension of the current execution in which each active process takes one more step or if they write different values to the same register. We observe that this graph can be represented by a faction graph. Using Theorem 5, we select a sufficiently large independent set of active processes in the conflict graph. All other processes are erased from the execution and then each process in the independent set takes its next step. Similarly to Anderson and Kim [7], this ensures that each process only reads the initial value of a register or the last value that it wrote there. The construction continues until only one process remains.
Let be the set of active processes that participate in the current execution, . In this execution, no process in sees any other process, so, for all processes , if and only if . By Lemma 2, there is at most one process that has terminated at the end of . Each process in that has not terminated has taken exactly steps in . We also ensure that no two processes write different values to the same register in their ’th step in , for . Initially, is empty and .
To create , we begin by partitioning the processes in into groups, where two processes are in the same group if, at the end of ,
-
they are poised to write the same value into the same register,
-
they are poised to read the same register and they have never written to that register, or
-
they are poised to read the same register and they last wrote the same value to that register.
If there is a process in that is terminated at the end of , it is put in a group by itself. For each register, there are at most groups of processes writing different values to the register, there is at most one group of processes that is reading the register, but have never written to it, and there are at most groups of processes that are reading the register and last wrote to it in one of the previous rounds.
We need to show that we can choose sufficiently many active processes , which each performs one more step, without letting it see any other process. Other active processes will be erased from the execution when creating . (Note that one of the processes in may have terminated.) To determine such a set of active processes, we construct a conflict graph. This is a graph with vertex set , where there is an edge between two processes if one of them is poised to read a register from which it could see the other process or both are poised to write different values to the same register. The conflict graph can be represented by a faction graph, where the factions are the groups of processes. We will describe only the set of super-edges, , of this faction graph from which the set of edges of the conflict graph can be deduced. Intuitively, we want to find an independent set in the conflict graph, remove all steps by other processes in , and add a round to the resulting execution to create .
There are two rules used to construct the super-edges of the faction graph:
Rule 1. Poised to read after a past write.
Consider some process, , that wrote a value to register during . Let be the value that last wrote to . Let be a group of processes that are poised to read register and last wrote the value to register or a group of processes that are poised to read register , but have never written to register , and is the initial value of register . In a solo execution, each process in would read the value when it performs this read. Then .
Rule 2. Poised to write different values.
Consider a group of processes, , poised to write value to a register and a group of processes, , poised to write value to the register . Then, , for all processes , and , for all processes .
Since all active processes take steps during , each process writes to at most different registers. For each register, , to which it wrote, by Rule 1, only if the processes in group are poised to read . At most one value is written to in each round of , so there are at most groups of processes poised to read that last wrote a different value to than did. There is at most one group of processes poised to read that have never written to . Hence, there are at most groups for which by Rule 1.
Suppose by Rule 2. Then is poised to write a value to a register at the end of and the processes in are poised to write a different value to register at the end of . Since the value contention of the algorithm is at most , there are at most different groups that are poised to write values other than to register at the end of . Hence, there are at most groups for which by Rule 2.
In total, Let be a maximum independent set in the conflict graph. By Theorem 5,
Since is closed with respect to , removing the steps of all processes in from results in an execution. Let be obtained from this execution by appending a round in which all processes in that are poised to read each take one step and then all processes in that are poised to write each take one step. Note that, by Rule 2, at most one value is written to each register during the last round of . Since at most one value is written to each register during each round of , the same is true for . Furthermore, since each process in that has not terminated takes exactly steps during , each process in that has not terminated takes exactly steps during .
Suppose there is a process, , in some group, , that sees another process during . Since sees no other processes during , it must be that, during round , read a value from register and, during , either did not write to , or last wrote some value to . By definition of the groups, the same is true for all processes in group . Note that all writes to during round occur after read . Let be any process that last wrote to during . Note that . By Rule 1, is an edge in the faction graph. This implies that is an edge in the conflict graph, which contradicts the fact that is an independent set. Hence, no process in sees another process during .
Thus, the execution has all the required properties. We repeatedly construct additional rounds until the remaining set of active processes has size 1. Note that, if , it is always possible to choose so that it contains a process that takes steps during . Let be the first number such that . Then is a solo execution of length .
It remains to show that . Recall that , so
Rearranging and using the facts that and , we obtain
Hence,
Let . Then , since . If , then . So, assume that . In this case,
Since , we have , so . Therefore, .
This theorem leads to some additional results. First, we observe that our lower bound argument can be applied directly to the more general class of non-deterministic solo-terminating algorithms [11], which includes randomized wait-free algorithms for the Leader Election problem.
Corollary 8.
Against an adaptive adversary, every randomized wait-free Leader Election algorithm for processes with value contention has worst-case expected step complexity and solo step complexity.
By specializing the parametrization to focus on particular ranges of interest, we obtain the following two results.
Corollary 9.
A Leader Election algorithm with constant solo step complexity is only possible if the number of different values a register can hold is polynomial in and, hence, only if the number of different processes that can be poised simultaneously poised to access the same register can be polynomial in .
Corollary 10.
Any (randomized) Leader Election algorithm that has solo step complexity (with high probability) has value contention that is super-polylogarithmic in .
We can also apply our theorem to adaptive Leader Election algorithms, where the step complexity depends on the number of processes that take at least one step, rather than on the total number of processes in the system.
Corollary 11.
For value contention , where is constant, it is impossible to solve Leader Election with expected solo step complexity (and, hence, with worst-case expected step complexity) , where is the number of participating processes and is an arbitrary function.
5 Upper Bounds
We discuss how existing upper bounds relate to our lower bounds. The related algorithms are listed in Table 2.
| Step Compl. | Total Step Compl. | Q | Reference | Comments | ||
|---|---|---|---|---|---|---|
| constant | [1] | with high probability | ||||
| [5] |
|
Leader Election with One-Bit Registers
Afek, Gafni, Tromp and Vitányi presented a Leader Election algorithm for processes with step complexity with high probability based on a tournament tree [1] using Leader Election for 2 processes at each internal node. Leader Election for 2 processes can be solved by the randomized algorithm of Tromp and Vitányi in expected constant step complexity using 4-valued shared registers [26]. We can then replace each 4-valued register with one-bit registers using the construction of [20]. Thus, the value contention, , of the resulting algorithm is . The step complexity of this algorithm matches our lower bound to within an factor.
Weak Leader Election Based on Splitters
Weak Leader Election differs from Leader Election in that it does not guarantee existence of a winner if there is more than one participating process. Alistarh, Gelashvili and Nadiradze proposed an algorithm for the Weak Leader Election problem with bounded write contention [5], which is based on Splitter objects. Their algorithm arranges processes into a complete -ary tournament tree, where each node is associated with a Splitter.
Since their tree is -ary, the write contention is bounded by and, consequently, the value contention is also bounded by . The construction in our proof of Theorem 7, ensures that processes do not see other processes, so our lower bound also applies to the Weak Leader Election problem. Therefore, there is an lower bound and an almost matching upper bound on the step complexity of this problem.
Adaptive RatRace Leader Election
Alistarh, Attiya, Gilbert, Giurgiu, and Guerraoui proposed an algorithm for solving Leader Election, which they call RatRace [4], that has step complexity with high probability and space complexity, where is the number of participating processes.
The algorithm consists of a primary tree and a backup grid. The primary tree is a complete binary tree of Randomized Splitters of depth . Every process starts at the root of the primary tree and then either stops or moves to the left or right child depending on the result (Stop, Left or Right) of the corresponding Randomized Splitter. Once a process obtains Stop, it tries to move back to the root by participating in an instance of Leader election among 3 processes: the process that received Stop from the the Randomized Splitter and one process from each child. The winner of the instance of Leader Election at a node moves back to its parent, if it has a parent. In the unlikely case when a process reaches a leaf of the tree without obtaining Stop, the process accesses the backup grid, which is a grid of deterministic Splitters [4] and instances of Leader Election among 3 processes. The winner of the backup grid and the winner of the instance of Leader Election at the root of the primary tree then participate in a final instance of Leader Election (among 2 processes) to decide the winner of the Leader Election among all processes. Giakkoupis and Woelfel improved the space complexity of the RatRace algorithm from to [14] by replacing the backup grid with elimination paths of size and an elimination path of size and reducing tree height from to .
The value contention of a Splitter shared by processes is , so the value contention of both these algorithms is . Corollary 11 proves that adaptive Leader Election is impossible unless is polynomial in . In particular, this means that any adaptive Leader Election algorithm has to use registers of size and it must have configurations in which process are poised to write different values to the same register.
6 Discussion
We made a step towards improving Leader Election bounds. Although we did not achieve a matching logarithmic lower bound that depends only on the number of processes, we proved tighter and more general lower bounds than previous work [5] by analyzing a new notion of value contention. Our primary contribution is the establishment of a new lower bound of
on the step complexity for any obstruction-free leader election algorithm.
Moreover, we have demonstrated that achieving step complexity requires value contention to be . On the other hand, we showed that adaptive leader election is impossible unless the value contention is also polynomial in , i.e. polynomially many processes can be simultaneously poised to write polynomially many different values to the same register. These impossibility results place fundamental limits on the design of efficient leader election algorithms.
Finally, we speculate that our approach stretches the existing approaches to their limit, and that further progress towards a general lower bound will require a more general technique that bounds the information flow achievable in the high-contention scenario where all processors can simultaneously be poised to write different values to the same register.
References
- [1] Yehuda Afek, Eli Gafni, John Tromp, and Paul M. B. Vitányi. Wait-free test-and-set (extended abstract). In Proceedings of the 6th International Workshop on Distributed Algorithms (WDAG), pages 85–94, 1992. doi:10.1007/3-540-56188-9_6.
- [2] Marcos Kawazoe Aguilera, Carole Delporte-Gallet, Hugues Fauconnier, and Sam Toueg. Stable leader election (extended abstract). In Proceedings of the 15th International Symposium on Distributed Computing (DISC), volume 2180 of Lecture Notes in Computer Science, pages 108–122, 2001.
- [3] Dan Alistarh and James Aspnes. Sub-logarithmic test-and-set against a weak adversary. In Proceedings of the 25th International Symposium on Distributed Computing (DISC), volume 6950 of Lecture Notes in Computer Science, pages 97–109, 2011. doi:10.1007/978-3-642-24100-0_7.
- [4] Dan Alistarh, Hagit Attiya, Seth Gilbert, Andrei Giurgiu, and Rachid Guerraoui. Fast randomized test-and-set and renaming. In Proceedings of the 24th international Symposium on Distributed Computing (DISC), volume 6343 of Lecture Notes in Computer Science, pages 94–108, 2010. doi:10.1007/978-3-642-15763-9_9.
- [5] Dan Alistarh, Rati Gelashvili, and Giorgi Nadiradze. Lower bounds for shared-memory leader election under bounded write contention. In Proceedings of the 35th International Symposium on Distributed Computing (DISC), volume 209 of LIPIcs, pages 4:1–4:17, 2021. doi:10.4230/LIPICS.DISC.2021.4.
- [6] Dan Alistarh, Rati Gelashvili, and Giorgi Nadiradze. Lower bounds for shared-memory leader election under bounded write contention, 2022. URL: https://arxiv.org/abs/2108.02802, arXiv:2108.02802.
- [7] James H. Anderson and Yong-Jik Kim. An improved lower bound for the time complexity of mutual exclusion. Distributed Computing, 15(4):221–253, 2002. doi:10.1007/S00446-002-0084-2.
- [8] Hagit Attiya, Fabian Kuhn, C. Greg Plaxton, Mirjam Wattenhofer, and Roger Wattenhofer. Efficient adaptive collect using randomization. Distributed Computing, 18(3):179–188, 2006. doi:10.1007/S00446-005-0143-6.
- [9] Hagit Attiya and Jennifer Welch. Distributed Computing. Fundamentals, Simulations, and Advanced Topics (second edition). Wiley, 2004.
- [10] Aryaz Eghbali and Philipp Woelfel. An almost tight RMR lower bound for abortable test-and-set. In Proceedings of the 32nd International Symposium on Distributed Computing (DISC), volume 121 of LIPIcs, pages 21:1–21:19, 2018. doi:10.4230/LIPICS.DISC.2018.21.
- [11] Faith Ellen, Rati Gelashvili, and Leqi Zhu. Revisionist simulations: A new approach to proving space lower bounds. In Proceedings of the 2018 ACM Symposium on Principles of Distributed Computing, PODC ’18, pages 61–70, New York, NY, USA, 2018. Association for Computing Machinery. doi:10.1145/3212734.3212749.
- [12] George Giakkoupis, Maryam Helmi, Lisa Higham, and Philipp Woelfel. An o(sqrt n) space bound for obstruction-free leader election. In Proceedings of the 27th International Symposium on Distributed Computing (DISC), volume 8205 of Lecture Notes in Computer Science, pages 46–60, 2013. doi:10.1007/978-3-642-41527-2_4.
- [13] George Giakkoupis, Maryam Helmi, Lisa Higham, and Philipp Woelfel. Test-and-set in optimal space. In Proceedings of the 47th Annual ACM Symposium on Theory of Computing (STOC), pages 615–623, 2015. doi:10.1145/2746539.2746627.
- [14] George Giakkoupis and Philipp Woelfel. On the time and space complexity of randomized test-and-set. In Proceedings of the 31st Annual ACM Symposium on Principles of Distributed Computing (PODC), pages 19–28, 2012. doi:10.1145/2332432.2332436.
- [15] George Giakkoupis and Philipp Woelfel. Efficient randomized test-and-set implementations. Distributed Computing, 32(6):565–586, 2019. doi:10.1007/S00446-019-00349-Z.
- [16] Wojciech Golab, Danny Hendler, and Philipp Woelfel. An o(1) RMRs leader election algorithm. In Proceedings of the 25th Annual ACM Symposium on Principles of Distributed Computing (PODC), pages 238–247, 2006. doi:10.1145/1146381.1146417.
- [17] Maurice Herlihy and Mark Tuttle. Wait-free computation in message-passing systems: Preliminary report. In Proceedings of the 9th Annual ACM Symposium on Principles of Distributed Computing (PODC), pages 347–362, 1990.
- [18] Johan Jensen. Sur les fonctions convexes et les inégalités entre les valeurs moyennes. Acta Mathematica, 30(1):175–193, 1906.
- [19] Yong-Jik Kim and James Anderson. A time complexity bound for adaptive mutual exclusion. Distributed Computing, 24(6):271–297, 2012.
- [20] Leslie Lamport. On interprocess communication. part I: Basic formalism. Distributed Computing, 1(2):77–85, 1986. doi:10.1007/BF01786227.
- [21] Leslie Lamport. A fast mutual exclusion algorithm. ACM Transactions on Computer Systems (TOCS), 5(1):1–11, 1987. doi:10.1145/7351.7352.
- [22] Nancy A. Lynch. Distributed Algorithms. Morgan Kaufmann, 1996.
- [23] Mark Moir and James H Anderson. Wait-free algorithms for fast, long-lived renaming. Science of Computer Programming, 25(1):1–39, 1995. doi:10.1016/0167-6423(95)00009-H.
- [24] Gary L. Peterson and Michael J. Fischer. Economical solutions for the critical section problem in a distributed system (extended abstract). In Proceedings of the 9th Annual ACM Symposium on Theory of Computing (STOC), pages 91–97, 1977. doi:10.1145/800105.803398.
- [25] Eugene Styer and Gary L. Peterson. Tight bounds for shared memory symmetric mutual exclusion problems. In Proceedings of the 8th Annual ACM Symposium on Principles of Distributed Computing (PODC), pages 177–191, 1989. doi:10.1145/72981.72993.
- [26] John Tromp and Paul Vitányi. Randomized two-process wait-free test-and-set. Distributed Computing, 15(3):127–135, 2002. doi:10.1007/S004460200071.
- [27] Paul Turán. On an extremal problem in graph theory. Matematikai és Fizikai Lapok, 48:436–452, 1941.
- [28] Jae-Heon Yang and James H Anderson. Time bounds for mutual exclusion and related problems. In Proceedings of the 26th Annual ACM symposium on Theory of Computing (STOC), pages 224–233, 1994. doi:10.1145/195058.195139.
