vault backup: 2025-03-25 12:47:48

This commit is contained in:
Marco Realacci 2025-03-25 12:47:48 +01:00
parent be5f1b39af
commit acfc662f8b
2 changed files with 23 additions and 10 deletions

View file

@ -43,6 +43,18 @@
"type": "tabs", "type": "tabs",
"dimension": 57.23495702005731, "dimension": 57.23495702005731,
"children": [ "children": [
{
"id": "b307be81cd26d1cb",
"type": "leaf",
"state": {
"type": "pdf",
"state": {
"file": "Concurrent Systems/slides/class 7.pdf"
},
"icon": "lucide-file-text",
"title": "class 7"
}
},
{ {
"id": "879210c00db77468", "id": "879210c00db77468",
"type": "leaf", "type": "leaf",
@ -230,12 +242,12 @@
}, },
"active": "43416c0d533d9ab4", "active": "43416c0d533d9ab4",
"lastOpenFiles": [ "lastOpenFiles": [
"Concurrent Systems/slides/class 8.pdf", "Concurrent Systems/slides/class 7.pdf",
"Concurrent Systems/notes/7- MUTEX-free concurrency.md", "Concurrent Systems/notes/7- MUTEX-free concurrency.md",
"Concurrent Systems/slides/class 8.pdf",
"Concurrent Systems/notes/8 - Enhancing Liveness Properties.md", "Concurrent Systems/notes/8 - Enhancing Liveness Properties.md",
"Pasted image 20250325090735.png", "Pasted image 20250325090735.png",
"Concurrent Systems/notes/images/Pasted image 20250324091452.png", "Concurrent Systems/notes/images/Pasted image 20250324091452.png",
"Concurrent Systems/slides/class 7.pdf",
"Concurrent Systems/notes/6 - Atomicity.md", "Concurrent Systems/notes/6 - Atomicity.md",
"Concurrent Systems/notes/5 - Software Transactional Memory.md", "Concurrent Systems/notes/5 - Software Transactional Memory.md",
"Concurrent Systems/notes/4c - Dining Philosophers.md", "Concurrent Systems/notes/4c - Dining Philosophers.md",

View file

@ -139,7 +139,7 @@ Idea: every operation is started by the invoking process and finalized by the ne
This is needed for the so called ABA problem with compare&set: This is needed for the so called ABA problem with compare&set:
- A typical use of compare&set is - A typical use of compare&set is
``` ```
stmp <- X tmp <- X
... ...
if X.compare&set(tmp, v) then ... if X.compare&set(tmp, v) then ...
``` ```
@ -153,13 +153,14 @@ TOP : a register that can be read or compare&setted
``` ```
push(w) := push(w) :=
while true do ⟨i,v,s⟩ <- TOP while true do
conclude(i,v,s) ⟨i,v,s⟩ <- TOP
if i=k then conclude(i,v,s)
return FULL if i=k then
newtop <- i+1,w,STACK[i+1].seq_num+1 return FULL
if TOP.compare&set(⟨i,v,s⟩,newtop) then newtop <- i+1,w,STACK[i+1].seq_num+1
return OK if TOP.compare&set(⟨i,v,s⟩,newtop) then
return OK
conclude(i, v, s) := conclude(i, v, s) :=
tmp <- STACK[i].val tmp <- STACK[i].val