vault backup: 2025-03-10 23:37:52
This commit is contained in:
parent
367d22ad37
commit
bd349a41c2
1 changed files with 2 additions and 12 deletions
|
@ -77,21 +77,11 @@ unlock(i) :=
|
||||||
STAGE[i] <- 0
|
STAGE[i] <- 0
|
||||||
FLAG[i] <- down
|
FLAG[i] <- down
|
||||||
```
|
```
|
||||||
|
|
||||||
Since the LOCK is like before, the revised protocol satisfies MUTEX. Furthermore, you can prove that it satisfies bounded bypass with bound n-1 -> EXERCISE!
|
Since the LOCK is like before, the revised protocol satisfies MUTEX. Furthermore, you can prove that it satisfies bounded bypass with bound n-1 -> EXERCISE!
|
||||||
|
|
||||||
Let's remember ourselves how is the locking function defined:
|
>[!note] let's remember ourselves [[### Aravind’s algorithm|the locking function]]
|
||||||
```
|
|
||||||
lock(i) :=
|
|
||||||
FLAG[i] <- up
|
|
||||||
repeat
|
|
||||||
STAGE[i] <- 0
|
|
||||||
wait (foreach j != i, FLAG[j] = down OR DATE[i] < DATE[j])
|
|
||||||
STAGE[i] <- 1
|
|
||||||
until foreach j != i, STAGE[j] = 0
|
|
||||||
```
|
|
||||||
|
|
||||||
(a causa di un bug di Obsidian, se non vedi la dimostrazione)
|
(a causa di un bug, riavvia Obsidian se non vedi la dimostrazione qui sotto)
|
||||||
>[!question]- mostra mia soluzione
|
>[!question]- mostra mia soluzione
|
||||||
>- $p_n$ invokes lock alone, completes its CS and so `DATE[n] = n`
|
>- $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`
|
>- then as DATE is either set to n or decreased, for each i, `DATE[i] < n`
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue