diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index 417af2d..9b1fd63 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -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", diff --git a/Concurrent Systems/notes/3.md b/Concurrent Systems/notes/3.md index 1c506e4..a1e09b1 100644 --- a/Concurrent Systems/notes/3.md +++ b/Concurrent Systems/notes/3.md @@ -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 \ No newline at end of file + - 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 `` 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) \ No newline at end of file