39 lines
2.4 KiB
Markdown
39 lines
2.4 KiB
Markdown
Given objects of type T and an object of type Z, is it possible to wait-free implement Z by using only objects of type T and atomic R/W registers?
|
|
|
|
If yes, then Z is not as essential as T (T can do everything Z can do).
|
|
|
|
But what is the **type** of an object?
|
|
1. the set of all the possible *values for states* of objects of that type
|
|
2. a set of *operations* for manipulating the object, each provided with a *specification*: a description of the conditions under which the operation can be invoked and the effect of the invocation
|
|
|
|
We focus on types whose operations are:
|
|
- **Total:** all operations can be invoked in any state of the object
|
|
- **Sequentially specified:** given the initial state, the behavior depends only by the sequence of operations, where the output to every operation invocation only depends on the input arguments and the invocations preceding it
|
|
- formally, $𝛿(s, op(args)) = {⟨s1,res1⟩,…, ⟨sk,resk⟩}$
|
|
- it is *deterministic* whenever k=1, for every s and every op(args)
|
|
- è deterministica quando dato uno stato e dato un'operazione, posso raggiungere solo uno stato (se raffigurato come grafo, ci sarebbe un solo arco)
|
|
- ricorda un po' gli automi o le Turing Machine
|
|
|
|
An object of type $T_{U}$ is **universal** if every other object can be wait-free implemented using only objects of type $T_U$ and atomic R/W registers.
|
|
|
|
This object is a **consensus object**: a *one-shot object* (every process can access it at most once) that provides only one operation `propose(v)` such that:
|
|
- **Validity:** the returned value (or *decided value*) is one of the arguments of the propose (*proposed value*) in one invocation done by a process (*participant*)
|
|
- **Integrity:** every process decides at most once
|
|
- **Agreement:** the decided value is the same for all processes
|
|
- **Wait-freedom:** every invocation of propose by a correct process terminates
|
|
|
|
Conceptually, we can implement a consensus object by a register X, initialized at ⊥, for which the propose operation is atomically defined as:
|
|
```
|
|
propose(v) :=
|
|
if X = ⊥ then
|
|
X <- v
|
|
return X
|
|
```
|
|
|
|
Universality of consensus holds as folows:
|
|
- given an object O of type Z
|
|
- each participant runs a local copy of O, all initialized at the same value
|
|
- create a total order on the operations O, by using consensus objects
|
|
- force all processes to follow this order to locally simulate O
|
|
- all local copies are consistent
|
|
|