vault backup: 2025-03-04 09:34:45

This commit is contained in:
Marco Realacci 2025-03-04 09:34:45 +01:00
parent 5136e40d3e
commit e4f6fdad25
3 changed files with 14 additions and 4 deletions

View file

@ -121,4 +121,14 @@ Let Y be the set of processes competing for the CS (suspended on the DLF.lock)
- otherwise, Y shrinks by one. And because of Observation 1, TURN and FLAG[TURN] don't change, so $p_y$ cannot enter Y again.
- Iterating this reasoning we can see that $p_i$ will eventually win, and the worst case is when is the last winner.
**Lemma 2:** If FLAG[i] = up, then TURN is set to i in at most $(n-1)^2$
**Lemma 2:** If FLAG[i] = up, then TURN is set to i in at most $(n-1)^2$ iterations.
If TURN=i when FLAG[i] is set, done
By Deadlock freedom of RR, at least one process eventually unlocks
- If FLAG[TURN] = down, then TURN is increased. Otherwise, by Lemam 1, $p_{TURN}$ wins in at most n-1 iterations and increases TURN.
- If now TURN = i then we are done. Otherwise, we repeat this reasoning.
The worst case is when TURN = *i+1* mod n when FLAG[i] is set.
![[Pasted image 20250304093223.png]]