vault backup: 2025-03-10 09:35:11

This commit is contained in:
Marco Realacci 2025-03-10 09:35:11 +01:00
parent d53e1037ad
commit a21e507d65
2 changed files with 15 additions and 6 deletions

View file

@ -146,4 +146,12 @@ Se il ticket number è minore si ottiene l'accesso, se il ticket number è ugual
> It is possible that while reading, other processes are writing their turn! So it's possible that I read something unpredictable! We need to consider it in the proofs.
Why is the flag needed? Without it, if two process $i$ and $j$ sets my_turn at the same time, t
###### Why is the flag needed?
Without it, if two process $i$ and $j$ sets MY_TURN at the same time, then $i$ goes to sleep, $j$ enters the CS, but when $i$ wakes up, it will enter too!
#### MUTEX proof
**Lemma 1:** if $p_i$ enters the bakery before $p_j$, then `MY_TURN[i] < MY_TURN[j]`.
*Proof:*
- let t be the value of `MY_TURN[i]` after $p_{i}$ exits the doorway (after flag <- down)
- when $p_j$ computes its ticket, it reads $t$ from `MY_TURN[i]`, it reads t from MY_TURNpi