vault backup: 2025-03-10 23:28:03

This commit is contained in:
Marco Realacci 2025-03-10 23:28:03 +01:00
parent e4e864a4e0
commit 668da058ec
3 changed files with 6 additions and 10 deletions

View file

@ -91,11 +91,11 @@ lock(i) :=
until foreach j != i, STAGE[j] = 0
```
- $p_n$ invokes lock alone, completes its CS and its new DATE is n
- all other $p_i, i \in P$ (with P being the set of all processes) will have `DATE[i] < n`, as their value for DATE is decreased
- $p_n$ invokes lock alone, completes its CS and so `DATE[n] = n`
- then as DATE is either set to n or decreased, for each i, `DATE[i] < n`
- *scenario 1*: every other $p_i$ keep invoking lock again immediately after the unlock
- every time some process exits the CS, `DATE[n]` is decreased
- 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
- eventually, more than one process will have its DATE set to 0
- but there will still be at most $n-1$ processes $p_i$ with `DATE[i] < DATE[n]`, this ensures that after $n-1$ -> ✅
- but there will still be at most $n-1$ processes $p_i$ with `DATE[i] < DATE[n]`, this ensures that after $n-1$ steps, every other process $p_i$ will have `DATE[i] > DATE[n]` -> ✅