diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index 347c2a3..9aee8e6 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -34,9 +34,9 @@ "type": "pdf", "state": { "file": "Concurrent Systems/slides/class 3.pdf", - "page": 15, + "page": 16, "left": -26, - "top": 106, + "top": 396, "zoom": 0.57541567695962 }, "icon": "lucide-file-text", @@ -218,9 +218,9 @@ }, "active": "6edd4157a160e462", "lastOpenFiles": [ - "Pasted image 20250310103703.png", "Concurrent Systems/slides/class 3.pdf", "Concurrent Systems/notes/3.md", + "Pasted image 20250310103703.png", "Concurrent Systems/notes/1 - CS Basics.md", "Concurrent Systems/notes/1 - CS Basics2.md", "Concurrent Systems/notes/2b - Round Robin algorithm.md", @@ -248,7 +248,6 @@ "Concurrent Systems/slides/class 1.pdf", "Concurrent Systems/notes/images/Pasted image 20250303093116.png", "Concurrent Systems/notes/images/Pasted image 20250303100953.png", - "Concurrent Systems/notes/images/Pasted image 20250303100721.png", "Foundation of data science/notes/1 CV Basics.md", "Foundation of data science/notes/7 Autoencoders.md", "Foundation of data science/notes/6 PCA.md", diff --git a/Concurrent Systems/notes/3.md b/Concurrent Systems/notes/3.md index ef12932..c74568d 100644 --- a/Concurrent Systems/notes/3.md +++ b/Concurrent Systems/notes/3.md @@ -255,4 +255,18 @@ unlock(i) := ![[Pasted image 20250310103703.png]] so by this, the very worst possible case is that my lock experiences that. -It looks like I can experience at most $2n-1$ other critical sections, but it is even better, let's see: \ No newline at end of file +It looks like I can experience at most $2n-1$ other critical sections, but it is even better, let's see: +... + + +#### Improvement of Aravind’s algorithm +``` +unlock(i) := + ∀j≠i.if DATE[j] > DATE[i] then + DATE[j] <- DATE[j]-1 + DATE[i] <- n STAGE[i] <- 0 + FLAG[i] <- down +``` + +Since the LOCK is like before, the revised protocol satisfies MUTEX. Furthermore, you can prove that it satisfies bounded bypass with bound n-1 -> EXERCISE! +