vault backup: 2025-03-25 12:47:48
This commit is contained in:
parent
be5f1b39af
commit
acfc662f8b
2 changed files with 23 additions and 10 deletions
16
.obsidian/workspace.json
vendored
16
.obsidian/workspace.json
vendored
|
@ -43,6 +43,18 @@
|
|||
"type": "tabs",
|
||||
"dimension": 57.23495702005731,
|
||||
"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",
|
||||
"type": "leaf",
|
||||
|
@ -230,12 +242,12 @@
|
|||
},
|
||||
"active": "43416c0d533d9ab4",
|
||||
"lastOpenFiles": [
|
||||
"Concurrent Systems/slides/class 8.pdf",
|
||||
"Concurrent Systems/slides/class 7.pdf",
|
||||
"Concurrent Systems/notes/7- MUTEX-free concurrency.md",
|
||||
"Concurrent Systems/slides/class 8.pdf",
|
||||
"Concurrent Systems/notes/8 - Enhancing Liveness Properties.md",
|
||||
"Pasted image 20250325090735.png",
|
||||
"Concurrent Systems/notes/images/Pasted image 20250324091452.png",
|
||||
"Concurrent Systems/slides/class 7.pdf",
|
||||
"Concurrent Systems/notes/6 - Atomicity.md",
|
||||
"Concurrent Systems/notes/5 - Software Transactional Memory.md",
|
||||
"Concurrent Systems/notes/4c - Dining Philosophers.md",
|
||||
|
|
|
@ -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:
|
||||
- A typical use of compare&set is
|
||||
```
|
||||
stmp <- X
|
||||
tmp <- X
|
||||
...
|
||||
if X.compare&set(tmp, v) then ...
|
||||
```
|
||||
|
@ -153,13 +153,14 @@ TOP : a register that can be read or compare&setted
|
|||
|
||||
```
|
||||
push(w) :=
|
||||
while true do ⟨i,v,s⟩ <- TOP
|
||||
conclude(i,v,s)
|
||||
if i=k then
|
||||
return FULL
|
||||
newtop <- ⟨i+1,w,STACK[i+1].seq_num+1⟩
|
||||
if TOP.compare&set(⟨i,v,s⟩,newtop) then
|
||||
return OK
|
||||
while true do
|
||||
⟨i,v,s⟩ <- TOP
|
||||
conclude(i,v,s)
|
||||
if i=k then
|
||||
return FULL
|
||||
newtop <- ⟨i+1,w,STACK[i+1].seq_num+1⟩
|
||||
if TOP.compare&set(⟨i,v,s⟩,newtop) then
|
||||
return OK
|
||||
|
||||
conclude(i, v, s) :=
|
||||
tmp <- STACK[i].val
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue