diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index 066abd6..c5dd9da 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -35,8 +35,7 @@ "title": "4 - Semaphores" } } - ], - "currentTab": 1 + ] } ], "direction": "vertical" @@ -205,10 +204,10 @@ "companion:Toggle completion": false } }, - "active": "e453bba00fdc57d6", + "active": "7c5b0ca6f7687800", "lastOpenFiles": [ - "Concurrent Systems/test/Untitled.md", "Concurrent Systems/notes/4 - Semaphores.md", + "Concurrent Systems/test/Untitled.md", "Concurrent Systems/notes/4b - Monitors.md", "Concurrent Systems/notes/4c - Dining Philosophers.md", "Concurrent Systems/notes/5 - Software Transactional Memory.md", diff --git a/Concurrent Systems/test/Untitled.md b/Concurrent Systems/test/Untitled.md index 54ec6ba..72d21aa 100644 --- a/Concurrent Systems/test/Untitled.md +++ b/Concurrent Systems/test/Untitled.md @@ -6,7 +6,9 @@ begin_read() := PR_MUTEX.down() R_MUTEX.down() R++ # currently active readers - if R = 1 then GLOB_MUTEX.down() + if R = 1 then + W_MUTEX.down() + GLOB_MUTEX.down() R_MUTEX.up() PR_MUTEX.up() return @@ -19,11 +21,14 @@ end_read() := return begin_write() := + W_MUTEX.down() + W_MUTEX.up() PR_MUTEX.down() GLOB_MUTEX.down() return end_write() := + PR_MUTEX.up() GLOB_MUTEX.up() return ``` \ No newline at end of file