vault backup: 2025-03-17 21:47:45

This commit is contained in:
Marco Realacci 2025-03-17 21:47:45 +01:00
parent ef080f08af
commit 110db2ace3
2 changed files with 24 additions and 4 deletions

View file

@ -36,7 +36,7 @@
"file": "Concurrent Systems/slides/class 5.pdf", "file": "Concurrent Systems/slides/class 5.pdf",
"page": 4, "page": 4,
"left": -23, "left": -23,
"top": 240, "top": 102,
"zoom": 0.652019002375297 "zoom": 0.652019002375297
}, },
"icon": "lucide-file-text", "icon": "lucide-file-text",
@ -215,10 +215,10 @@
"companion:Toggle completion": false "companion:Toggle completion": false
} }
}, },
"active": "51157f32453cba69", "active": "6edd4157a160e462",
"lastOpenFiles": [ "lastOpenFiles": [
"Concurrent Systems/notes/5 - Software Transactional Memory.md",
"Concurrent Systems/slides/class 5.pdf", "Concurrent Systems/slides/class 5.pdf",
"Concurrent Systems/notes/5 - Software Transactional Memory.md",
"Concurrent Systems/notes/4c - Dining Philosophers.md", "Concurrent Systems/notes/4c - Dining Philosophers.md",
"Concurrent Systems/notes/3a - Hardware primitives & Lamport Bakery algorithm.md", "Concurrent Systems/notes/3a - Hardware primitives & Lamport Bakery algorithm.md",
"Concurrent Systems/notes/2b - Round Robin algorithm.md", "Concurrent Systems/notes/2b - Round Robin algorithm.md",

View file

@ -63,7 +63,27 @@ begin_T() :=
birthdate(T) <- CLOCK + 1 birthdate(T) <- CLOCK + 1
X.read_T() := X.read_T() :=
if lc?(XX) != if lc?(XX) != ⊥ then
return lc(XX).val
lc(XX) <- XX
if lc(XX).date >= birthdate(T) then
ABORT
read_set(T) <- read_set(T) U {X}
return lc(XX).val
X.write_T(v) :=
if lc(XX) = ⊥ then
lc(XX) <- newloc
lc(XX).val <- v
write_set(T) <- write_set(T) U {X}
try_to_commit_T() :=
lock all read_set(T) U write_set(T)
∀ X ∈ read_set(T)
if XX.date >= birthdate(T) then
release all locks
ABORT
``` ```
### Virtual World Consistency ### Virtual World Consistency