From 0798769a15273dfd055d8083c861a4537ae40c4d Mon Sep 17 00:00:00 2001 From: Marco Realacci Date: Sat, 5 Apr 2025 00:11:00 +0200 Subject: [PATCH] vault backup: 2025-04-05 00:11:00 --- .obsidian/workspace.json | 9 ++++----- Concurrent Systems/notes/4 - Semaphores.md | 2 +- Concurrent Systems/notes/4c - Dining Philosophers.md | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index 723c430..5a72d5c 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -74,8 +74,7 @@ "title": "Segnalibri" } } - ], - "currentTab": 1 + ] } ], "direction": "horizontal", @@ -190,10 +189,11 @@ "companion:Toggle completion": false } }, - "active": "954699747dc12b5e", + "active": "6550032d28b9171c", "lastOpenFiles": [ - "\u0002.md", + "Concurrent Systems/notes/4 - Semaphores.md", "Concurrent Systems/notes/4c - Dining Philosophers.md", + "\u0002.md", "Concurrent Systems/notes/1b - Peterson algorithm.md", "Concurrent Systems/notes/2b - Round Robin algorithm.md", "Concurrent Systems/notes/10 - Implementing Consensus.md", @@ -201,7 +201,6 @@ "Concurrent Systems/notes/images/Pasted image 20250405000438.png", "Pasted image 20250405000428.png", "Concurrent Systems/notes/3b - Aravind's algorithm and improvements.md", - "Concurrent Systems/notes/4 - Semaphores.md", "Concurrent Systems/notes/4b - Monitors.md", "Concurrent Systems/a.md", "Concurrent Systems/notes/images/Pasted image 20250404235033.png", diff --git a/Concurrent Systems/notes/4 - Semaphores.md b/Concurrent Systems/notes/4 - Semaphores.md index 48a3f63..ba1dad2 100644 --- a/Concurrent Systems/notes/4 - Semaphores.md +++ b/Concurrent Systems/notes/4 - Semaphores.md @@ -180,7 +180,7 @@ producer A: - so producer A will write at `BUF[0]` - but wait! Consumer B is still reading there - **Producer A doesn't give a fuck.** - ![]() + ![200](images/Pasted%20image%2020250312121828.png)` *don't be like Producer A, be more like Bob, who always scans EMPTY before!* So the issue here is that producers just assume that IN is the first available slot. But it its not necessarily the case. diff --git a/Concurrent Systems/notes/4c - Dining Philosophers.md b/Concurrent Systems/notes/4c - Dining Philosophers.md index 8bd0533..b259546 100644 --- a/Concurrent Systems/notes/4c - Dining Philosophers.md +++ b/Concurrent Systems/notes/4c - Dining Philosophers.md @@ -3,7 +3,7 @@ The first real practical example of a concurrent system. - one chopstick between each pair of philosophers - a philosophers must pick up its two nearest chopsticks in order to eat - a philosopher must pick up first one chopstick, then the second one, not both at once -![]() +![100](images/Pasted%20image%2020250317100456.png)` **PROBLEM:** *Devise a deadlock-free algorithm for allocating these limited resources (chopsticks) among several processes (philosophers).*