diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index 47d531b..53fa912 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -34,9 +34,9 @@ "type": "pdf", "state": { "file": "Concurrent Systems/slides/class 4.pdf", - "page": 13, + "page": 14, "left": -27, - "top": 96, + "top": 94, "zoom": 0.5754156769596199 }, "icon": "lucide-file-text", diff --git a/Concurrent Systems/notes/4b -.md b/Concurrent Systems/notes/4b -.md index 423abac..2928348 100644 --- a/Concurrent Systems/notes/4b -.md +++ b/Concurrent Systems/notes/4b -.md @@ -55,4 +55,18 @@ C.signal() := PRIO.down() NPR-- ``` -p.s. The wait **always** suspends, even if there is only a process. \ No newline at end of file +p.s. The wait **always** suspends, even if there is only a process. + +#### Readers/Writers problem, strong priority to Readers +``` +monitor RW_READERS := + AR, WR, AW, WW init at 0 + condition CR, CW + +operation begin_read() := + WR++ + if AW != 0 then + CR.wait() + CR.signal() + +``` \ No newline at end of file