A Hierarchy of Unrestricted Deterministic Objects with Consensus Number 1
Abstract
The consensus number of a shared object is the maximum number of processes that can solve consensus in a wait-free manner using copies of the object and registers. In 2016, to prove that an object is not fully characterized by its consensus number, Afek, Ellen and Gafni showed that for all integers , there exists an infinite sequence of deterministic objects of consensus number with strictly increasing computational power. In 2018, Daian, Losa, Afek, and Gafni constructed an infinite sequence of deterministic objects of consensus number 1 with strictly decreasing computational power, but the single operation that each of these objects supports is restricted in how it can be used during an execution. As restrictions can have an effect on an object’s consensus number, it was left as an open question whether the same result holds without this restriction.
In this paper, we construct an infinite sequence of unrestricted deterministic objects with strictly decreasing computational power. All objects in this sequence have consensus number 1.
Keywords and phrases:
Shared Memory, Wait-free, Set Agreement, Consensus Hierarchy2012 ACM Subject Classification:
Theory of computation Distributed computing modelsAcknowledgements:
I want to thank my advisor Faith Ellen for her many helpful discussions. I also want to thank Sam Toueg and Roei Tell for their feedback and advice.Funding:
This work was supported in part by the Natural Science and Engineering Research Council grant RGPIN-2020-04178.Editors:
Andrei Arusoaie, Emanuel Onica, Michael Spear, and Sara Tucci-PiergiovanniSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
In 1991, Herlihy [10] classified objects based on their consensus number, which is the maximum number of processes that can solve consensus in a wait-free manner using copies of the object and registers. An object has an infinite consensus number if it is possible to solve consensus for any number of processes using copies of the object and registers. This classification partially characterizes an object’s computational power: if object has a consensus number and object has a larger consensus number, then in systems with more than processes, there is no implementation of using copies of and registers. Furthermore, in systems of processes, there is a implementation of every object using copies of and registers.
However, in 2016, Afek, Ellen, and Gafni [2] showed that the consensus number of a deterministic object does not fully characterize its computational power when it is at least 2. This was done by introducing the deterministic objects for all integers . Object has consensus number and can be implemented from a suitably initialized object. Furthermore, it was shown that there is no implementation of an object using objects and registers in systems of processes. Therefore, for all , the infinite sequence has strictly increasing computational power and consists only of deterministic objects with consensus number .
In 2018, Daian, Losa, Afek, and Gafni [8] introduced a deterministic object, , with consensus number 1, for all integers . Each object supports a single operation that takes two inputs, a value and an integer modulo . It requires that, in any execution, there are at most invocations of the operation on the object, each with a different second input. For integers , objects and registers can implement objects in systems of or fewer processes, but there is no implementation of objects using objects and registers in systems of processes. Hence, the infinite sequence has strictly decreasing computational power.
However, restrictions on the number of times that an object can be accessed can change an object’s consensus number. For example, consider the
-consensus object, for integers . It supports a single operation, propose, that can be invoked at most times.
This operation takes a non-negative integer as input and returns the input of its first call. Note that an -consensus object has consensus number . Consider a modified -consensus object that can be accessed an unlimited number of times. The first call of the modified object’s operation returns its own input. Subsequent calls return . While a -consensus object has consensus number , the consensus task for 2 processes can be solved using a copy of the modified object and 2 single-writer registers: Each process writes its input to its register, calls propose
with this input, and outputs its own value if it is returned. Otherwise, it outputs the value it reads from the register to which the other process wrote.
Although an unrestricted version of a object, , was introduced in [8], the paper did not show that this object has consensus number 1, nor that is strictly more powerful than for . In fact, we show in Appendix A that their argument for objects does not work for objects. Thus, it is natural to ask if a similar infinite sequence exists for unrestricted deterministic objects with consensus number 1.
In this paper, we show that such a sequence does exist by introducing a deterministic object, , with consensus number 1, for all integers . This object supports one operation that takes an integer modulo as input. Unlike the object, there is no restriction on how an object can be used. Using known properties of the set agreement task, we show that, for , an object can be implemented from objects and registers in systems of or fewer processes, but an object cannot be implemented from objects and registers in systems of processes. Thus, the infinite sequence has strictly decreasing computational power.
In Section 2, we provide our model description and definitions of relevant tasks and objects. In Section 3, we provide a solution to the -set agreement task for processes using objects and registers. In Section 4, we provide an implementation of objects in systems of processes using an arbitrary solution to the -set agreement task for processes and registers. We then show how the existence of this implementation implies that objects have consensus number 1. In Section 5, we use properties of the set agreement task to show that, for , objects are weaker than objects. In Section 6, we describe some related results and directions for future research.
2 Preliminaries
We consider the standard asynchronous shared memory model [10], where processes communicate using objects. Each object has a set of possible values and supports a set of operations. We only consider sequentially specified objects. This means that each operation (together with its input) maps the current value of an object to a set of possible new values and responses. When an operation is applied to , a value and response are chosen from the result of the mapping. An operation is deterministic if, for each input, it maps the current value to a single value and a single response. An object is deterministic if all of its supported operations are deterministic.
A system of processes consists of the set of processes , where is the additive group of integers modulo . Each process, , has a unique identifier, . In each step, a process applies an operation to an object. Each process must take steps according to the algorithm it is executing, and these steps are scheduled by an adversary. Processes are susceptible to crash failures: they may stop taking steps before they have finished performing an algorithm. A faulty process is one that crashes. Every algorithm considered in this paper is wait-free. This means that every non-faulty process completes its algorithm within a finite number of its own steps regardless of what other processes do.
A configuration specifies the state of every process and the value of every shared object. An execution is an alternating sequence of configurations and steps, starting from an initial configuration. An implementation of an object consists of a representation of from a set of base objects and algorithms for each process to perform when applying an operation supported by . In an execution of the implementation, , processes call operations of using these algorithms. A linearization of is a sequential execution, , consisting of all completed operations in and a subset of the uncompleted operations in . satisfies two conditions. First, the result of each completed operation in is the same as in . Second, for any two operations and in , if is completed in before begins, then occurs before in . An implementation of is said to be linearizable if there is a linearization of every execution of the implementation [11]. All implementations considered in this paper are linearizable.
In a task, every process starts with an input and is supposed to produce an output. A solution to a task is a set of objects and an algorithm that describes how processes use these objects to produce a suitable output. In the consensus task, the output values in each execution must satisfy the following properties.
-
Validity: Every output is the input of some process.
-
Agreement: All outputs have the same value.
The consensus number of an object is the maximum number of processes that can solve the consensus task using copies of the object and registers. An object has an infinite consensus number if it is possible to solve consensus for any number of processes using copies of the object and registers.
A generalization of the consensus task is the -set agreement task [6]. In this task, agreement is replaced with the -agreement property.
-
-agreement: There are at most different output values.
Note that the 1-set agreement task is another name for the consensus task. The relationship between different set agreement tasks has been partially characterized by Chaudhuri and Reiners [7].
Theorem 1 (Partial Order Theorem).
Let and be positive integers. The -set agreement task for processes can be solved using copies of arbitrary solutions to the -set agreement task for processes and registers if and only if or .
In particular, for integers , the -set agreement task for processes cannot be solved using copies of arbitrary solutions to the -set agreement task for processes and registers.
For integers , the object can be used to solve the -set agreement task. It supports the non-deterministic operation, propose, which takes a non-negative integer as input. In any sequence of propose operations invoked on the object, each propose operation returns a value that was either the input of or the input of a previous propose operation. In any execution, propose returns at most distinct values. The sequential specification of an object is given in Algorithm 1. Chan, Hadzilacos, and Toueg [3] showed that objects can be implemented in systems of processes from snapshot objects and any solution to the -set agreement task for processes.
A snapshot object supports the atomic operations scan and update. A scan returns a view, which consists of the values of all components of the object. An update overwrites the value of component of the object with the value .
We also allow processes to read individual components of a snapshot object. This can be implemented by having
processes perform a scan and then throw away all other components of the result.
Note that snapshot objects can be implemented from registers [1].
In this paper, we introduce the deterministic family of set-and-read-next objects. For integers , an object supports the operation srn: . For all and sequences of srn calls invoked on an object, an srn call returns 1 if and only if some srn call was invoked earlier in the sequence. Otherwise, it returns 0. Another way of thinking of the object is to consider an array of registers, . Each register in this array is initialized to 0. When an srn call is invoked for some , the object atomically writes 1 to and returns the value in . The pseudocode for this definition is given in Algorithm 2.
3 Solving set agreement using objects and registers
In this section, we show that the -set agreement task for processes can be solved using an object and registers. This is done in Algorithm 3. Each process writes its input to its register , calls srn on the object, and outputs its own value if is returned. If is returned, the process reads and outputs from .
Lemma 2.
Algorithm 3 solves the -set agreement task for processes.
Proof.
Let be a process. If the srn call on line 2 returns 0, then outputs . If the srn call returns 1, then performed line 2 before did. Therefore, performed line 1 before performed line 2, so reads and outputs from on line 5. As outputs either or , validity is satisfied.
If any process is faulty, there are at most different output values. So, suppose every process is non-faulty. Then, the first srn call performed returns 0 and the -th srn call performed returns 1. This implies that there exists some such that the srn call invoked by returns 0 and the srn call invoked by returns 1. Each process either outputs or . As neither nor output , no process outputs . Thus, there are at most different output values, so -agreement is satisfied.
Corollary 3.
For integers , the -set agreement task for processes can be solved using an object and registers.
This can be done by having processes perform Algorithm 3 and having the remaining processes output their own input values.
4 Implementing objects from solutions to set agreement and registers
4.1 The Implementation
In this section, we implement an object for processes using an arbitrary solution to the -set agreement task for processes and registers. We use snapshot objects, which can be implemented from registers [1]. We also use an object, which can be implemented in systems of processes from any solution to the -set agreement task for processes and registers [3].
The implementation is given in Algorithm 4. It takes inspiration from Daian, Losa, Afek, and Gafni’s [8] implementation of an object, but modifications have been made to allow each process to perform operations an unlimited number of times. As a result, the linearizations of our executions are significantly more complicated, as, in our case, we have to handle infinite executions, executions where multiple processes perform the same operation concurrently, as well as executions where the same operation is performed multiple times, but different values are returned.
Our implementation uses a -component snapshot object to represent the array of registers of the object. Each srn call begins by reading from . If an srn call reads from , it updates to 1.
The first linearized srn call must return 0. Some of the first srn calls may access an object, . A process performing one of these srn calls uses its ID as the input to .propose. If the propose call returns this input, the srn call returns 0. In particular, the first srn call to invoke propose returns 0. To prevent srn calls that start later from accessing , we use a doorway. The doorway is closed before any srn call returns.
The srn calls that do not access or do not return immediately after their access to help one another to return appropriate values. Each of these srn calls will perform a scan of (on line 7 or 16) and store the resulting view (on line 9 or 18) in another snapshot object, , in the component corresponding to the number of ’s that the view contains. Since each component of can only change from to , in any execution, the views in are ordered by when they are taken.
An srn() call that reads from (on line 1) returns the -th component of its view of (on line 20). Now consider an srn() call that reads from and either does not access or does not return immediately after its access to . If it finds a view stored in in which and , it returns . Otherwise, it returns . Note that this srn call cannot simply return the -th component of its view of . To see why, consider the following incorrect execution, where . First, an srn call performs a solo execution, closing the doorway before returning . Then, an srn call, , reads from and updates it to and an srn call, , reads from and updates it to . Next, performs a scan of and returns . An srn call, , then performs a solo execution, updating to before returning . Finally, performs a scan of and returns . Since returns 1, it must be linearized after and, since returns 1, it must be linearized after . However, this cannot happen since returns before starts.
It is possible that no srn call reads an open doorway. For example, consider an execution in which a call of srn reads on line 1, updates to 1 on line 2, and then
another call of srn reads 1 from on line 1, and executes lines 16 to 20.
The doorway is closed on line 19 before any process can read an open doorway, so no process will access the object, ,
during the execution or in any extension of it.
When there are at most concurrent srn calls, the algorithm still guarantees that one of the first srn calls return 0 even if no srn call reads an open doorway.
This is because of the views of that are contained in .
However, our implementation does not always work when there are more than concurrent srn calls. For example, consider the following execution that begins with a call of srn that reads from on line 1 and updates to 1 on line 2, for each . Then, a second call of srn reads from on line 1 and closes the doorway on line 19. Note that, in every extension of this execution, every scan of on lines 7 and 16 consists only of 1s, so no call returns 0 on line 13. Moreover, no call reads an open doorway, so no call returns 0 on line 6. Since all srn calls returns , the execution cannot be linearized.
4.2 Properties of the Implementation
Fix a non-empty execution of our implementation of in which every srn call returns.
Observation 4.
Every srn call returns 0 or 1.
Lemma 5.
For all such that , no two srn calls update with different views.
Proof.
A process only updates with a view of containing 1s. is an atomic snapshot object that initially has 0 in all its components and the only updates to it change a single component to 1. Thus, each distinct view of consists of a unique number of 1s.
Observation 6.
The doorway closes before any srn call returns.
Note that the doorway can be open when a process performs line 19. For example, suppose an srn call performs lines 1 and 2 and goes to sleep. Then, another srn call performs line 1 followed by lines 16 to 19.
Lemma 7.
If no srn calls encounter an open doorway on line 3, is updated with a view of that contains at least one and one .
Proof.
Suppose no srn calls encounter an open doorway on line 3. Then, line 4 is never performed. Therefore, the doorway is closed on line 19. Let be the first srn call to perform line 19. Let and respectively be the input of and the process that invoked it. Since performs line 19, reads 1 from on line 1. Thus, some other srn call updated to 1 before performs line 1. Let be the process that invoked .
The doorway is open before performs line 19. Therefore, by Lemma 6, no srn call returns before performs line 19. Thus, . Note that both and start but do not return an srn call before performs line 19. As there are only processes, this implies that there exists a such that no srn call has started before performs line 19. Therefore, if is the result of the scan performed during , then and . is updated with this view on line 18 of .
Lemma 8.
At least one srn call returns 0.
Proof.
First, suppose at least one srn call encounters an open doorway on line 3. Of these srn calls, in the first srn call to perform line 5, propose returns its input. Therefore, this srn call returns 0 on line 6.
So, suppose that no srn call encounters an open doorway on line 3. By Lemma 7,
is updated with a view, , of , before the doorway closes. Furthermore, contains at least one 1 and one 0.
As consists of only 1’s and 0’s, there exists such that and . As , at least one srn call has updated the value of to 1 on line 2. As no srn call encounters an open doorway on line 3, performs line 3 after the doorway closes. This implies that when performs a scan of on line 10,
is already updated with . Thus, returns 0 on line 13.
Proof.
Suppose returns 0 on line 13. Then, there exists an integer such that the result, , of the scan of performed on line 10 satisfies and . In other words, before performs line 10, was updated with some view, , of such that and .
So, suppose returns 0 on line 20. Then, reads from on line 1. Thus, the result, , of the scan of performed on line 16 satisfies . As returns 0, . is updated to a component of on line 18.
Lemma 10.
There exists an such that no srn call returns 0.
Proof.
Let be the set of inputs such that some srn call reads an open doorway on line 3.
First, suppose . Then, .
By Lemma 6, the doorway closes before any srn call returns. Thus, all srn calls that read an open doorway are concurrent. Since there are only processes and some srn call reads an open doorway for each , each process first calls srn with a different input. All of these calls read an open doorway on line 3 before any of them close the doorway on line 4. Since these calls all update to 1 on line 2, the result of each scan of performed on line 7 and 16 during the run has 1 in every component. Thus, no srn call returns 0 on line 13 or 20. Some process does not get its identifier back from on line 5. Let be the input to the first srn call by this process. Since this srn call does not perform line 6 and all other srn calls read on line 1, no srn call performs line 6.
Thus, no srn call returns 0.
So, suppose . For the sake of contradiction, assume that, for all , some srn call returns 0.
For each , the first srn call that performs line 1 reads 0 from and so performs line 2. For each , let be the first srn call that performs line 2. Let . Thus, .
Let be the last call in to perform line 2. Since , no srn call reads an open doorway on line 3. Thus, no srn call returns 0 on line 6. By assumption, some srn call returns 0. By Lemma 9, this implies that a scan of such that its result, , satisfies and , is performed before the call returns. Thus, is updated from 0 to 1 after is. Since is updated from 0 to 1 when performs line 2 and is the last call in to perform line 2, it follows that . This implies some srn call reads an open doorway on line 3. Thus, the scan that resulted in is performed before the doorway closes.
Let be the srn call in which the scan that resulted in is performed.
Let be the set of srn calls that read an open doorway on line 3. Then .
Since the doorway is closed before any srn call performs line 7, the scan that resulted in is performed on line 16. Thus, . Since the scan that resulted in is performed before the doorway closes, starts before the doorway closes. By definition, all calls in perform line 3 before the doorway closes.
Furthermore, the scan that resulted in is performed after performs line 2.
Thus, all calls in start before the doorway closes. By Lemma 6, no calls return prior to the doorway closing. Therefore, at least srn calls execute concurrently, which cannot occur with just processes.
Thus, by contradiction, there exists an such that no srn call returns 0.
Lemma 11.
Let . Let be an srn call that returns 1. Then all srn calls that start after returns also return 1.
Proof.
If returns on line 14, then performs a scan of with result on line 7. As has updated to on line 2, . Since does not return on line 13, . Similarly, if returns 1 on line 20, . Thus, before returns, is updated to 1. Let be an srn call that starts after returns. When performs line 1, . Thus, performs a scan of on line 16 with result and then returns on line 20. Since is updated to 1 before returns, . Therefore, returns .
Lemma 12.
Let . Let be an srn call. If some srn call returns before starts, then returns 1.
Proof.
Suppose that some srn call returns before starts. This implies that before starts, has been updated to 1 and the doorway is closed.
If reads on line 1, then the result, , of the scan of performed by on line 16 satisfies . Thus, if reads on line 1, returns on line 20.
Proof.
Distinguished Calls.
For each , let be the set of srn calls that start before any srn call returns. Note that is non-empty as long as there is at least one srn call in the execution.
In this case,
we distinguish exactly one srn call as follows.
-
If there exists a call in that returns 0, of these calls, let be the one that starts first.
-
Otherwise, let be the
srncall that performs line 2 first.
There are two very useful properties regarding these distinguished calls.
Lemma 14.
Let such that . If returns 1, then all srn calls return 1.
Proof.
From the way that is chosen, if returns 1, then all calls in return 1. Furthermore, as the first srn call to return is in and thus returns 1, by Lemma 11, all srn calls that start after it returns also return 1.
Lemma 15.
Let . Let be an srn call. If or returns before starts, then returns 0.
Proof.
If , then no srn calls are performed. If and returns 1, then by definition, is the srn call that updates from 0 to 1. In both cases, returns before is updated to 1. Note that either returns on line 6 or performs line 7 or 16. By Lemma 13, also returns 0 in the latter case.
So, suppose and returns 0. For the sake of contradiction, assume returns 1. By the contrapositive of Lemma 13, some srn call updates to 1 before returns. As returns before starts, starts before starts. By definition, out of all the srn calls that return 0, starts first. Thus, returns 1.
As returns 1 before starts, is updated to 1 before starts. Therefore, reads on line 1 and performs lines 16 to 20. As returns 0, when performs line 16. As returns 1, updates with a view, , of , such that . As returns before starts, . Since executes line 2 and returns 1, returns 1 on line 14. As does not return on line 13, executes line 10 before updates with . This implies a scan of is performed on line 7 of before starts. Let be the result of the scan. As updates to 1 on line 2, . Since also returns 1, . Thus, before starts, is updated to 1. Therefore, returns 1. This is a contradiction, so returns 0.
Execution Graph.
The execution graph
(of the execution)
is the directed graph , where is the set of srn calls in the execution and if and only if one of the following
properties are satisfied
for some :
-
1.
is an
srncall that returns 0 and is ansrncall -
2.
is a distinguished call and is an
srncall that returns 1
As shown in Lemmas 16 and 19, is acyclic and encodes nice temporal relationships between srn calls.
Note that consecutive nodes in have input values that differ by 1 modulo .
Additionally,
in any directed path consisting of strictly increasing input values, all srn calls, except possibly the last one, return 0.
Similarly,
in any directed path consisting of strictly decreasing input values, all srn calls, except possibly the last one, are distinguished and all srn calls, except possibly the first one, return 1.
Furthermore, does not contain any directed path , where and are srn calls and let is an srn call. This is because would imply that returns 1 but would imply that returns 0.
Lemma 16.
contains no directed cycles.
Proof.
For the sake of contradiction, suppose that contains a directed cycle.
First, suppose that at least one node in the cycle returns 1. By the definition of , all nodes that can be reached from this node also return 1. Furthermore, each edge of the cycle goes from an srn call to an srn call for some . As each node in a directed cycle has an outgoing edge, all nodes in the cycle are distinguished srn calls.
Thus, the cycle contains distinguished calls of every possible input.
Therefore, for all , returns 1. By Lemma 14, all srn calls return 1. This contradicts Lemma 8.
So, suppose that all nodes in the cycle return 0. Then, each edge in the cycle goes from an srn call to an srn call for some , so the cycle contains calls of every possible input. This means that for every input, at least one srn call returns 0. This contradicts Lemma 10.
Thus, by contradiction, contains no directed cycles.
Lemma 17.
Let be a directed path with strictly increasing input values from some srn call to some srn call . Suppose that the doorway is closed before starts. Then, for all srn calls such that , starts before is updated to 1.
Proof.
We will prove this lemma by induction.
Suppose reads on line 1. Then, performs a scan of on line 16. As returns 0, the result of the scan, , satisfies . Thus, performs the scan before is updated to 1, so starts before is updated to 1.
Now, suppose reads on line 1. This implies starts before is updated to 1. As does not read an open doorway, returns on line 13. By Lemma 9, before returns, is updated with a view, , of , such that and . This implies is updated to 1 before is updated to 1. Thus, starts before is updated to 1.
Let where and , and assume that starts before is updated to 1. Hence, starts before reads on line 1 or updates to 1 on line 2. Since the doorway is closed before starts, returns 0 on line 13 or 20. By Lemma 9, before returns, is updated with a view, , of , such that and . This implies is updated to 1 before is. As starts before is updated to 1, starts before is updated to 1.
Lemma 18.
Let be a directed path with strictly decreasing input values from some srn call to some srn call .
If the srn call that updates from 0 to 1 returns 1, then is updated to 1 before updates .
Proof.
Since returns 1, it performs a scan of before it updates . Hence, if is updated to 1 before performs a scan of , then it is updated to 1 before updates . So, suppose that performs a scan of before is updated to 1. As returns 1, the contrapositive of Lemma 13 implies that is updated to 1 before performs a scan of . This implies the result of the scan, , satisfies and .
Let be the srn call that updates from to .
Suppose that returns 1.
Then it performs line 2 and returns on line 14.
By the contrapositive of Lemma 13, is updated to 1 before performs a scan of on line 7.
We prove that is updated to 1 before updates by strong induction on the length of . Suppose that the lemma is true for all directed paths of shorter length.
If , then performs a scan of on line 10 before updates with on line 9 or 18. This is because and does not return on line 13. In this case, is updated to 1 before updates .
So, suppose that .
If is a path of length 1, then ,
so . Thus, has length greater than 1.
Recall that .
Let be the last srn call in such that its input, , satisfies .
Then and
is not equal to and .
Let be the srn call following in .
Since is a distinguished srn call that returns 1,
it performs line 2
and returns on line 14.
Moreover, and , so performs a scan of on line 10 before updates with .
Let be the prefix of path that ends with . By the induction hypothesis applied to , is updated to 1 before updates on line 9. This occurs before performs a scan of on line 10, which is before updates .
Lemma 19.
Let be a directed path from some srn call to some srn call . Then, starts before returns.
Proof.
By Lemma 6, if starts before the doorway is closed, starts before any srn call returns. So, assume that starts after the doorway is closed.
We need to consider three separate cases, as can consist of strictly increasing input values, strictly decreasing input values, or increasing input values followed by decreasing input values.
First, we consider the case where consists of strictly increasing input values.
As there is some srn call in , by Lemma 17, starts before is updated to 1. Since is updated to 1 before returns, this implies that starts before returns.
Now, we consider the case where consists of strictly decreasing input values.
Suppose starts before is updated to 1.
If the length of is 1, then and returns 1. By the contrapositive of Lemma 13, is updated to 1 on line 2 before performs a scan of on line 7 or 16. This implies is updated to 1 before updates . Thus, starts before returns.
On the other hand, if the length of is greater than , then .
Hence, the srn call immediately after in is and it returns 1.
This implies is the srn call that updates from 0 to 1. Thus, by applying Lemma 18 to the suffix of starting at , we see that is updated to 1 before updates . Once again, starts before returns.
So, suppose starts after is updated to 1. Thus, reads on line 1 and performs lines 16 to 20.
Note that and is not the srn call that updates to 1. Thus, returns 0. This implies that the result, , of the scan that performs on line 16 satisfies . Therefore, performs line 16 before is updated to 1. Let be the srn call that updates from 0 to 1. As is not distinguished and starts before , returns 1. By Lemma 18, is updated to 1 before returns. Thus, performs line 16 before returns.
Finally, we consider the case where consists of increasing input values followed by decreasing input values. In other words, contains some sub-path , where , and are srn calls and is an srn call. Since , it follows that returns 0. Thus, by definition, also returns 0. Similarly, since , returns 1. Therefore, . By definition of , has no outgoing edges, so .
4.3 Linearization
We first linearize finite executions of Algorithm 4 in which every invocation of srn returns. Then, we show how to linearize any execution, even if it is infinite or processes crash.
Linearizing finite executions where every srn call returns.
Fix an execution . Let be its execution graph. Let be the srn call in that returns first, and let be the set of srn calls in that start before returns. In particular, . By Lemma 16, contains no directed cycles. Thus, either is a source, or there exists a source in such that there is a directed path from to . By Lemma 19, starts before returns, so .
Algorithm 5 returns a linearization of the execution.
This algorithm topologically sorts
, while guaranteeing that if an srn call returns before another srn call starts in , then is ordered before .
For , let denote that occurs before in the linearization.
Lemma 20.
Let be srn calls in . If returns before starts in , then .
Proof.
Let us prove the contrapositive. Suppose . Let , , and be the respective values of , , and when is added to . Then, is a vertex in and . By definition of , starts before returns in . Furthermore, since is the first call in to return and is a vertex in , returns at or before returns. Thus, starts before returns in .
Lemma 21.
Let . Let be an srn call in . Then, returns 1 in if and only if there exists an srn call in such that .
Proof.
First, suppose returns 1 in . By the contrapositive of Lemma 15, and starts before returns. By part 2 of the definition of execution graph, . In each iteration of the while loop of Algorithm 5, only sources are added to the end of . Therefore, is added to before , so .
Now, suppose returns 0 in . Let in be any srn call. By part 1 of the definition of
execution graph,
. In each iteration of the while loop of Algorithm 5, only sources are added to the end of . Thus, . Therefore, there do not exist any srn calls such that .
By Lemmas 20 and 21, Algorithm 5 returns a linearization of the execution.
Linearizing arbitrary executions.
Now, consider an execution of our implementation of that may be infinite and may contain invocations of srn that do not return.
Let be a step in after which no incomplete srn call takes another step.
Initially, for all . Note that each process may read on line 1 only during its first call of srn. If a process reads on line 1, it only performs lines 1 and 16 to 20. Let be a step in after which no srn call performs any of lines 2 to 14.
Let be whichever of and occurs last. Let be the prefix of up to and including and let be the remainder of . Let be the subset of incomplete srn calls in that update on line 2 or on line 18. Let be the execution that starts with , but with the removal of the incomplete srn calls not in . This is followed by the continuation of each call in until it completes, which is then followed by the steps in .
The calls removed from do not modify any of the shared objects, so the behavior of the other calls is the same in and in . Processes that take steps in do not invoke any of the srn calls in . Therefore, the state of the processes that take steps in are the same in and immediately before any step in is performed. During , only lines 1 and 16 to 20 are performed, so is the only shared object that is read. As is only updated on line 2, the calls in do not update after in . Thus, the behaviour of each call in except for those in is the same as in , so is a valid execution.
Let be the set of srn calls that start in . Consider the shortest prefix of in which every call in returns. Let be the continuation of this execution in which each incomplete srn call takes steps until it completes. Since these incomplete srn calls start in , the only shared object they read from is . Since is only updated prior to , the value returned by each of these calls is the same in and in . Notice is a finite execution in which every srn call returns. Then, Algorithm 5 produces a linearization of . Let be the sequential execution obtained from by appending the remaining calls in in the order in which they start.
In , each srn call returns the same value as in , which is the value returned in . Consider any srn call, , that is in , but not . This implies that, in , starts in . First, suppose returns 1 in . Then, some srn call occurred before in . This srn call also occurs in . Hence, is updated to 1 (on line 2) during . As line 2 is not performed during , immediately prior to . Thus, returns 1 in . Now, suppose returns 0 in . Then no srn call has occurred in , which implies no srn call occurs during . As line 2 is not performed during , it follows that throughout . Thus, returns 0 in . Therefore, each srn call in returns the same value as in .
Let be an srn call in that returns before another srn call begins. First, suppose that . Then . As returns before starts in , returns before starts in . Therefore, occurs before in and, hence, in as well. Now suppose that . If , then occurs before in , since is a prefix of . If , then occurs before in , because starts before in . Thus, is a linearization of .
contains every completed call in , so it contains every completed call in . Furthermore, each completed call in returns the same value as in and, hence, as in . If an srn call returns before another srn call begins in , then returns before in . Therefore, occurs before in . Thus, is a linearization of .
Lemma 22.
For , objects can be implemented in systems of or fewer processes from any solution to the -set agreement task and registers.
An important consequence of this lemma is that objects have consensus number 1.
Lemma 23.
For , objects have consensus number 1.
Proof.
For the sake of contradiction, suppose that objects have a consensus number of at least 2. This would imply that the consensus task for 2 processes can be solved using objects and registers. Thus, by Lemma 22, the consensus task for 2 processes can be solved using any solution to the -set agreement task for processes and registers. This contradicts Theorem 1.
5 is weaker than
Let be integers such that . In this section, we show that objects are strictly weaker than objects. Therefore, the infinite sequence has strictly decreasing computational power.
Lemma 24.
An object can be implemented from objects and registers in systems of or fewer processes.
Proof.
Corollary 3 states that a solution to the -set agreement task for processes can be implemented from objects and registers in systems of processes. Thus, by Lemma 22, an object can be implemented from objects and registers in systems of or fewer processes.
Lemma 25.
An object cannot be implemented from objects and registers in systems of processes.
Proof.
For the sake of contradiction, assume that an object can be implemented from objects in systems of processes. By Lemma 22, an object can be implemented in systems of or fewer processes from any solution to the -set agreement task for processes. Therefore, an object can be implemented in systems of processes from any solution to the -set agreement task for processes and registers. Thus, by Corollary 3, a solution to the -set agreement task for processes can be implemented from any solution to the -set agreement task for processes and registers. This contradictions Theorem 1.
6 Closing Remarks
This paper, in conjunction with the work of Afek, Ellen, and Gafni [2], shows that consensus number does not fully characterize the computational power of a deterministic object.
There are more refined classifications of an object’s computational power. The -set agreement number of a shared object is the largest integer such that the -set agreement task for processes can be solved using copies of the object and registers [9]. An object has an infinite -set agreement number if it is possible to solve -set agreement for any number of processes using copies of the object and registers. The set agreement power of an object is the infinite sequence of the object’s set agreement numbers, [3].
Chan, Hadzilacos, and Toueg [3] have shown that there exists a non-deterministic object with set agreement power for all sequences such that for . These objects have a fixed number of ports, with the restriction that 2 or more processes cannot be simultaneously poised to perform operations on the same port in any execution. The behavior of operations supported by this object depend on the port on which the operation is performed on. An interesting consequence of this result is that there exists uncountably many objects with distinct computational power. Thus, it would be interesting to see if the same result holds for deterministic objects without the restriction of ports.
Set agreement power does not fully characterize the computational power of objects. Chan, Hadzilacos and Toueg [5] showed that for every , there exists a deterministic object and a non-deterministic object such that and both have no ports and have set agreement power , but cannot be implemented from copies of and registers. Chan, Hadzilacos and Toueg [4] also proved a similar result for deterministic objects. For all , the -P&G deterministic object has the same set agreement power as an -consensus object, but cannot be implemented from -consensus objects and registers. However, unlike the previous pair of objects, P&G objects have ports, and the behavior of operations depend on the port on which it is performed on.
It is open whether the same result holds for deterministic objects without ports, as well as for objects with consensus number . Furthermore, it is unclear whether the number of deterministic objects corresponding to each set agreement power is infinite. If this is the case, proving this will require ingenuity, as the infinite sequences of deterministic objects constructed in both this paper and the paper by Afek, Ellen and Gafni [2] relied on known properties of the set agreement task.
References
- [1] Yehuda Afek, Hagit Attiya, Danny Dolev, Eli Gafni, Michael Merritt, and Nir Shavit. Atomic snapshots of shared memory. J. ACM, 40(4):873–890, September 1993. doi:10.1145/153724.153741.
- [2] Yehuda Afek, Faith Ellen, and Eli Gafni. Deterministic objects: Life beyond consensus. In Proceedings of the 2016 ACM Symposium on Principles of Distributed Computing, PODC ’16, pages 97–106, 2016. doi:10.1145/2933057.2933116.
- [3] David Yu Cheng Chan, Vassos Hadzilacos, and Sam Toueg. On the number of objects with distinct power and the linearizability of set agreement objects. In 31st International Symposium on Distributed Computing (DISC 2017), volume 91 of Leibniz International Proceedings in Informatics (LIPIcs), pages 12:1–12:14, 2017. doi:10.4230/LIPIcs.DISC.2017.12.
- [4] David Yu Cheng Chan, Vassos Hadzilacos, and Sam Toueg. On the classification of deterministic objects via set agreement power. In Proceedings of the 2018 ACM Symposium on Principles of Distributed Computing, PODC ’18, pages 71–80, 2018. doi:10.1145/3212734.3212775.
- [5] David Yu Cheng Chan, Vassos Hadzilacos, and Sam Toueg. Life beyond set agreement. Distributed Computing, 33(3):255–277, June 2020. doi:10.1007/s00446-020-00372-5.
- [6] Soma Chaudhuri. More choices allow more faults: Set consensus problems in totally asynchronous systems. Information and Computation, 105(1):132–158, 1993. doi:10.1006/inco.1993.1043.
- [7] Soma Chaudhuri and Paul Reiners. Understanding the set consensus partial order using the borowsky-gafni simulation. In Distributed Algorithms, pages 362–379, 1996.
- [8] Eli Daian, Giuliano Losa, Yehuda Afek, and Eli Gafni. A Wealth of Sub-Consensus Deterministic Objects. In 32nd International Symposium on Distributed Computing (DISC 2018), volume 121 of Leibniz International Proceedings in Informatics (LIPIcs), pages 17:1–17:17, 2018. doi:10.4230/LIPIcs.DISC.2018.17.
- [9] Carole Delporte-Gallet, Hugues Fauconnier, Eli Gafni, and Petr Kuznetsov. Set-Consensus Collections are Decidable. In 20th International Conference on Principles of Distributed Systems (OPODIS 2016), volume 70 of Leibniz International Proceedings in Informatics (LIPIcs), pages 7:1–7:15, 2017. doi:10.4230/LIPIcs.OPODIS.2016.7.
- [10] Maurice Herlihy. Wait-free synchronization. ACM Trans. Program. Lang. Syst., 13(1):124–149, January 1991. doi:10.1145/114005.102808.
- [11] Maurice Herlihy and Jeannette Wing. Linearizability: a correctness condition for concurrent objects. ACM Trans. Program. Lang. Syst., 12(3):463–492, July 1990. doi:10.1145/78969.78972.
Appendix A Why an approach to showing properties of objects does not work
One important step in [8] was to show that objects can be implemented in systems of processes from solutions to set agreement and registers. Their implementation appears in Algorithm 6. They used this result to show that objects have consensus number 1 and that objects are weaker than for .
In their implementation, each process is only allowed to call wrn at most once. Furthermore, the first input of each call must match the process’s identifier.
In this section, we show that if processes are allowed to perform operations multiple times, the unrestricted object obtained from this implementation is either non-linearizable or non-deterministic.
Consider the following three executions of Algorithm 6 for any :
-
is a sequential execution in which performs
wrn(0,1), performswrn(1,1), performswrn(2,1), and performswrn(0,1). In this execution, thewrn(1,1) call returns . -
In , process first completes an
wrncall. Then, performswrnand performswrnconcurrently, alternating steps. Before any scans of are performed, , , and are all updated to 1. This implies that the result, , of any scan of performed on line 6 satisfies . Both calls return, with thewrncall returning 1. Finally, callswrn(0,1), which returns 1.
If this is a linearizable, deterministic object, the linearization of the 4 operations and the values that they return in must be the same as in or . But this is not the case. Therefore, this implementation cannot be used to show that objects have consensus number 1 and that objects are weaker than for . In fact, it is unknown whether these two properties are true.
