vault backup: 2025-03-10 23:32:52
This commit is contained in:
parent
668da058ec
commit
367d22ad37
3 changed files with 20 additions and 13 deletions
|
@ -91,11 +91,14 @@ lock(i) :=
|
|||
until foreach j != i, STAGE[j] = 0
|
||||
```
|
||||
|
||||
- $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$ steps, every other process $p_i$ will have `DATE[i] > DATE[n]` -> ✅
|
||||
(a causa di un bug di Obsidian, se non vedi la dimostrazione)
|
||||
>[!question]- mostra mia soluzione
|
||||
>- $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$ steps, every other process $p_i$ will have `DATE[i] > DATE[n]` -> ✅
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue