vault backup: 2025-04-02 23:20:03

This commit is contained in:
Marco Realacci 2025-04-02 23:20:03 +02:00
parent c14ac3253c
commit af2d7f19c7
2 changed files with 41 additions and 20 deletions

View file

@ -13,30 +13,29 @@
"state": { "state": {
"type": "markdown", "type": "markdown",
"state": { "state": {
"file": "Concurrent Systems/notes/1 - CS Basics.md", "file": "Concurrent Systems/test/Untitled.md",
"mode": "source", "mode": "source",
"source": false "source": false
}, },
"icon": "lucide-file", "icon": "lucide-file",
"title": "1 - CS Basics" "title": "Untitled"
} }
}, },
{ {
"id": "ae1e669229aa09dc", "id": "e453bba00fdc57d6",
"type": "leaf", "type": "leaf",
"state": { "state": {
"type": "markdown", "type": "markdown",
"state": { "state": {
"file": "Concurrent Systems/notes/1 - CS Basics.md", "file": "Concurrent Systems/notes/4 - Semaphores.md",
"mode": "source", "mode": "source",
"source": false "source": false
}, },
"icon": "lucide-file", "icon": "lucide-file",
"title": "1 - CS Basics" "title": "4 - Semaphores"
} }
} }
], ]
"currentTab": 1
} }
], ],
"direction": "vertical" "direction": "vertical"
@ -205,31 +204,31 @@
"companion:Toggle completion": false "companion:Toggle completion": false
} }
}, },
"active": "2b2245f56092006e", "active": "7c5b0ca6f7687800",
"lastOpenFiles": [ "lastOpenFiles": [
"Concurrent Systems/notes/4b - Monitors.md",
"Concurrent Systems/notes/1 - CS Basics.md",
"Concurrent Systems/test/Untitled.md",
"Concurrent Systems/notes/4 - Semaphores.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",
"Concurrent Systems/notes/6 - Atomicity.md",
"Concurrent Systems/notes/7- MUTEX-free concurrency.md",
"Concurrent Systems/notes/9 - Consensus.md",
"Concurrent Systems/slides/class 9.pdf",
"Concurrent Systems/slides/class 10.pdf",
"Concurrent Systems/notes/1 - CS Basics.md",
"Concurrent Systems/test", "Concurrent Systems/test",
"Concurrent Systems/notes/3a - Hardware primitives & Lamport Bakery algorithm.md", "Concurrent Systems/notes/3a - Hardware primitives & Lamport Bakery algorithm.md",
"Concurrent Systems/notes/9 - Consensus.md",
"Concurrent Systems/notes/6 - Atomicity.md",
"Concurrent Systems/notes/5 - Software Transactional Memory.md",
"Concurrent Systems/notes/10 - Implementing Consensus.md", "Concurrent Systems/notes/10 - Implementing Consensus.md",
"HCIW/slides/Tangible User Interfaces.pdf", "HCIW/slides/Tangible User Interfaces.pdf",
"Concurrent Systems/notes/images/Pasted image 20250401083747.png", "Concurrent Systems/notes/images/Pasted image 20250401083747.png",
"Concurrent Systems/notes/images/Pasted image 20250401092557.png", "Concurrent Systems/notes/images/Pasted image 20250401092557.png",
"Concurrent Systems/notes/3b - Aravind's algorithm and improvements.md", "Concurrent Systems/notes/3b - Aravind's algorithm and improvements.md",
"Concurrent Systems/notes/4c - Dining Philosophers.md",
"Concurrent Systems/notes/1b - Peterson algorithm.md", "Concurrent Systems/notes/1b - Peterson algorithm.md",
"Concurrent Systems/notes/2 - Fast mutex by Lamport.md", "Concurrent Systems/notes/2 - Fast mutex by Lamport.md",
"Concurrent Systems/notes/7- MUTEX-free concurrency.md",
"Concurrent Systems/slides/class 10.pdf",
"Concurrent Systems/notes/2b - Round Robin algorithm.md", "Concurrent Systems/notes/2b - Round Robin algorithm.md",
"Concurrent Systems/notes/6a - Alternatives to Atomicity.md", "Concurrent Systems/notes/6a - Alternatives to Atomicity.md",
"Concurrent Systems/notes/8 - Enhancing Liveness Properties.md", "Concurrent Systems/notes/8 - Enhancing Liveness Properties.md",
"Concurrent Systems/slides/class 9.pdf",
"Concurrent Systems/slides/class 6.pdf", "Concurrent Systems/slides/class 6.pdf",
"Concurrent Systems/slides/class 5.pdf", "Concurrent Systems/slides/class 5.pdf",
"Concurrent Systems/notes/images/Pasted image 20250325090735.png", "Concurrent Systems/notes/images/Pasted image 20250325090735.png",
@ -252,7 +251,6 @@
"HCIW/exercises/Exercise.md", "HCIW/exercises/Exercise.md",
"Foundation of data science/notes/1 CV Basics.md", "Foundation of data science/notes/1 CV Basics.md",
"Foundation of data science/notes/7 Autoencoders.md", "Foundation of data science/notes/7 Autoencoders.md",
"Foundation of data science/notes/6 PCA.md",
"Senza nome.canvas" "Senza nome.canvas"
] ]
} }

View file

@ -1,3 +1,26 @@
``` ```
barrier() := GLOB_MUTEX and R_MUTEX semaphores init. at 1
R a shared register init. at 0
begin_read() :=
R_MUTEX.down()
R++ # currently active readers
if R = 1 then GLOB_MUTEX.down()
R_MUTEX.up()
return
end_read() :=
R_MUTEX.down()
R--
if R = 0 then GLOB_MUTEX.up()
R_MUTEX.up()
return
begin_write() :=
GLOB_MUTEX.down()
return
end_write() :=
GLOB_MUTEX.up()
return
``` ```