From d936a0790817be3e72be93684fa1de40213c11fe Mon Sep 17 00:00:00 2001 From: Marco Realacci Date: Wed, 2 Apr 2025 23:30:03 +0200 Subject: [PATCH] vault backup: 2025-04-02 23:30:03 --- .obsidian/workspace.json | 7 ++++--- Concurrent Systems/test/Untitled.md | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index c5dd9da..066abd6 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -35,7 +35,8 @@ "title": "4 - Semaphores" } } - ] + ], + "currentTab": 1 } ], "direction": "vertical" @@ -204,10 +205,10 @@ "companion:Toggle completion": false } }, - "active": "7c5b0ca6f7687800", + "active": "e453bba00fdc57d6", "lastOpenFiles": [ - "Concurrent Systems/notes/4 - Semaphores.md", "Concurrent Systems/test/Untitled.md", + "Concurrent Systems/notes/4 - Semaphores.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 b0aef03..54ec6ba 100644 --- a/Concurrent Systems/test/Untitled.md +++ b/Concurrent Systems/test/Untitled.md @@ -3,12 +3,12 @@ GLOB_MUTEX and R_MUTEX semaphores init. at 1 R a shared register init. at 0 begin_read() := - PRIO_MUTEX.down() + PR_MUTEX.down() R_MUTEX.down() R++ # currently active readers if R = 1 then GLOB_MUTEX.down() R_MUTEX.up() - PRIO_MUTEX.up() + PR_MUTEX.up() return end_read() := @@ -19,6 +19,7 @@ end_read() := return begin_write() := + PR_MUTEX.down() GLOB_MUTEX.down() return