diff --git a/.obsidian/app.json b/.obsidian/app.json index 6abe4c1..e69de29 100644 --- a/.obsidian/app.json +++ b/.obsidian/app.json @@ -1,3 +0,0 @@ -{ - "alwaysUpdateLinks": true -} \ No newline at end of file diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index f0739e3..01c65bd 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -51,8 +51,7 @@ "title": "class 3" } } - ], - "currentTab": 1 + ] } ], "direction": "vertical" @@ -224,10 +223,10 @@ "companion:Toggle completion": false } }, - "active": "dd6c003f9d17b0e9", + "active": "6edd4157a160e462", "lastOpenFiles": [ - "Concurrent Systems/slides/class 3.pdf", "Concurrent Systems/notes/3b - Aravind's algorithm and improvements.md", + "Concurrent Systems/slides/class 3.pdf", "Concurrent Systems/notes/3a - Hardware primitives & Lamport Bakery algorithm.md", "Concurrent Systems/notes/1 - CS Basics.md", "Concurrent Systems/notes/2b - Round Robin algorithm.md", diff --git a/Concurrent Systems/notes/3b - Aravind's algorithm and improvements.md b/Concurrent Systems/notes/3b - Aravind's algorithm and improvements.md index 84952fb..53196e1 100644 --- a/Concurrent Systems/notes/3b - Aravind's algorithm and improvements.md +++ b/Concurrent Systems/notes/3b - Aravind's algorithm and improvements.md @@ -91,11 +91,11 @@ lock(i) := until foreach j != i, STAGE[j] = 0 ``` -- $p_n$ invokes lock alone, completes its CS and its new DATE is n -- all other $p_i, i \in P$ (with P being the set of all processes) will have `DATE[i] < n`, as their value for DATE is decreased +- $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` - *scenario 1*: every other $p_i$ keep invoking lock again immediately after the unlock - every time some process exits the CS, `DATE[n]` is decreased - after $n-1$ turns, `DATE[n]` will have `DATE[n] = 1`, with every other `DATE[i] > 1, i!=n` -> ️✅ - *scenario 2*: not every process invokes the lock - eventually, more than one process will have its DATE set to 0 - - but there will still be at most $n-1$ processes $p_i$ with `DATE[i] < DATE[n]`, this ensures that after $n-1$ -> ✅ \ No newline at end of file + - but there will still be at most $n-1$ processes $p_i$ with `DATE[i] < DATE[n]`, this ensures that after $n-1$ steps, every other process $p_i$ will have `DATE[i] > DATE[n]` -> ✅