vault backup: 2025-03-10 10:05:14

This commit is contained in:
Marco Realacci 2025-03-10 10:05:14 +01:00
parent 5db269c6a1
commit 6c34cb80f2
2 changed files with 19 additions and 3 deletions

View file

@ -34,9 +34,9 @@
"type": "pdf",
"state": {
"file": "Concurrent Systems/slides/class 3.pdf",
"page": 10,
"page": 11,
"left": -26,
"top": 603,
"top": 49,
"zoom": 0.57541567695962
},
"icon": "lucide-file-text",

View file

@ -178,4 +178,20 @@ By contradiction, assume that there is a lock but nobody enters its CS
- All processes in the bakery (we will call this set Q) are blocked in their wait
- The first wait cannot block forever
- All $p_i \in Q$ have their FLAG down
- All $p_i \not \in Q$ have their FLAG down
- All $p_i \not \in Q$ have their FLAG down (if not in the doorway) or will eventually put their FLAG down (cannot remain in the doorway forever)
- The second wait cannot block all of them forever
- Tickets can be totally ordered (lexicographically)
- Let `<MY_TURN[i], j>` be the minimun
- The second wait evaluated by $p_i$ eventually succeeds for all j
- if $p_j$ is before the doorway, then `MY_TURN[j] = 0`
- if $p_{j}$ is in the doorway, then `MY_TURN[i] < MY_TURN[j]` (bc of Lemma 1)
- if $p_j$ is in the bakery, by assumption `⟨MY_TURN[i] , i⟩ < ⟨MY_TURN[j] , j⟩` since it is the minimum.
#### Bounded bypass proof (bound n-1)
Let pi and pj competing for the CS and pj wins
Then, pj enters its CS, completes it, unlocks and then invokes lock again
- If pi has entered the CS, √
- Otherwise, by Lemma1, MY_TURN[i] < MY_TURN[j], then pj cannot bypass pi again!
- At worse, pi has to wait all other proceeses before entering its CS
- (indeed, since there is no deadlock, when pi is waiting somebody enters the CS)