vault backup: 2025-03-10 23:23:12
This commit is contained in:
parent
3e85b472af
commit
e4e864a4e0
1 changed files with 1 additions and 17 deletions
|
@ -98,20 +98,4 @@ lock(i) :=
|
||||||
- after $n-1$ turns, `DATE[n]` will have `DATE[n] = 1`, with every other `DATE[i] > 1, i!=n` -> ️✅
|
- after $n-1$ turns, `DATE[n]` will have `DATE[n] = 1`, with every other `DATE[i] > 1, i!=n` -> ️✅
|
||||||
- *scenario 2*: not every process invokes the lock
|
- *scenario 2*: not every process invokes the lock
|
||||||
- eventually, more than one process will have its DATE set to 0
|
- eventually, more than one process will have its DATE set to 0
|
||||||
- there will be at most $n-1$ processes $p_i$ with `DATE[i] < DATE[n]` -> ✅
|
- but there will still be at most $n-1$ processes $p_i$ with `DATE[i] < DATE[n]`, this ensures that after $n-1$ -> ✅
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
**Lemma 1:** Suppose we have $n$ processes, then $\not \exists p_{j} : DATE[j]=DATE[i] \forall i \in [0, n]$ (non esistono due processi con lo stesso valore per DATE)
|
|
||||||
*Proof:*
|
|
||||||
- Suppose $p_j$ is the last process to execute unlock, then `DATE[j] = n` and for each i, `DATE[i] < n`, as DATE is either set to $n$ or decreased.
|
|
||||||
- by iterating this reasoning, it is clear that until every DATE is > 0, we have no processes with the same value for DATE.
|
|
||||||
- What if we reach 0?
|
|
||||||
- Let's suppose that $p_i$ is the first process that reaches `DATE = 0`
|
|
||||||
|
|
||||||
**Lemma 2:** DATE's bounds are $[0, n]$
|
|
||||||
*Proof:*
|
|
||||||
For the upper bound, it's trivial: DATE is either decreased or set to $n$.
|
|
||||||
...
|
|
Loading…
Reference in a new issue