diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index fd95102..d33a0c7 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -28,12 +28,12 @@ "state": { "type": "markdown", "state": { - "file": "Concurrent Systems/notes/3b - Aravind's algorithm and improvements.md", + "file": "Concurrent Systems/notes/3a - Hardware primitives & Lamport Bakery algorithm.md", "mode": "source", "source": false }, "icon": "lucide-file", - "title": "3b - Aravind's algorithm and improvements" + "title": "3a - Hardware primitives & Lamport Bakery algorithm" } } ], @@ -208,8 +208,8 @@ }, "active": "0b5880764d0a0d29", "lastOpenFiles": [ - "Concurrent Systems/notes/3a - Hardware primitives & Lamport Bakery algorithm.md", "Concurrent Systems/notes/3b - Aravind's algorithm and improvements.md", + "Concurrent Systems/notes/3a - Hardware primitives & Lamport Bakery algorithm.md", "Concurrent Systems/notes/4 - Semaphores.md", "Concurrent Systems/notes/5 - Software Transactional Memory.md", "Concurrent Systems/notes/4c - Dining Philosophers.md", diff --git a/Concurrent Systems/notes/3a - Hardware primitives & Lamport Bakery algorithm.md b/Concurrent Systems/notes/3a - Hardware primitives & Lamport Bakery algorithm.md index 5e554f0..155d6b4 100644 --- a/Concurrent Systems/notes/3a - Hardware primitives & Lamport Bakery algorithm.md +++ b/Concurrent Systems/notes/3a - Hardware primitives & Lamport Bakery algorithm.md @@ -141,27 +141,6 @@ lock(i) := unlock(i) := MY_TURN[i] <- 0 - - - - - -lock(i) := - FLAG[i] <- up - max_turn <- max{MY_TURN[1],...,MY_TURN[n]} - if max_turn > 2n then - MY_TURN[i] = 1 - else - MY_TURN[i] = max_turn + 1 - - - FLAG[i] <- down - forall j != i - wait FLAG[j] = down - wait (MY_TURN[j] = 0 OR ⟨MY_TURN[i],i⟩ < ⟨MY_TURN[j],j⟩) - -unlock(i) := - MY_TURN[i] <- 0 ``` Se il ticket number è minore si ottiene l'accesso, se il ticket number è uguale, allora si vede il process ID minore.