vault backup: 2025-03-10 23:18:12
This commit is contained in:
parent
89becae151
commit
3e85b472af
1 changed files with 2 additions and 3 deletions
|
@ -93,13 +93,12 @@ lock(i) :=
|
||||||
|
|
||||||
- $p_n$ invokes lock alone, completes its CS and its new DATE is n
|
- $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
|
- 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
|
||||||
- suppose every process invoke lock, then $p_n$ has to wait all other processes to complete their CSs
|
|
||||||
- *scenario 1*: every other $p_i$ keep invoking lock again immediately after the unlock
|
- *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
|
- 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` -> ️✅
|
- 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,
|
- 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]` -> ✅
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue