vault backup: 2025-03-03 09:02:47
This commit is contained in:
parent
d4234a5acb
commit
fd4c390b08
3 changed files with 22 additions and 2 deletions
5
.obsidian/workspace.json
vendored
5
.obsidian/workspace.json
vendored
|
@ -36,9 +36,9 @@
|
|||
"type": "pdf",
|
||||
"state": {
|
||||
"file": "Concurrent Systems/slides/class 1.pdf",
|
||||
"page": 2,
|
||||
"page": 4,
|
||||
"left": -22,
|
||||
"top": 596,
|
||||
"top": 42,
|
||||
"zoom": 0.7036817102137768
|
||||
},
|
||||
"icon": "lucide-file-text",
|
||||
|
@ -220,6 +220,7 @@
|
|||
},
|
||||
"active": "bfdcb298848e6147",
|
||||
"lastOpenFiles": [
|
||||
"Pasted image 20250303090135.png",
|
||||
"Concurrent Systems/slides/class 1.pdf",
|
||||
"Concurrent Systems/notes/Lezione1.md",
|
||||
"Concurrent Systems/notes",
|
||||
|
|
|
@ -42,3 +42,22 @@ Different processes work to let all of them succeed in their task.
|
|||
- only produced data can be consumed
|
||||
- every datum can be consumed at most once
|
||||
|
||||
#### Competition
|
||||
Different processes aim at executing some action, but only one of them succeeds.
|
||||
Usually, this is related to the access of the same shared resource.
|
||||
|
||||
Example: two processes want to withdraw from a bank account.
|
||||
|
||||
```js
|
||||
function withdraw() {
|
||||
x := account.read();
|
||||
if x ≥ 1M€ {
|
||||
account.write(x – 1M€);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
While `read()` and `write()` may be considered as atomic, their sequential composition **is not**.
|
||||
|
||||
![[Pasted image 20250303090135.png]]
|
||||
|
||||
|
|
BIN
Pasted image 20250303090135.png
Normal file
BIN
Pasted image 20250303090135.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 33 KiB |
Loading…
Reference in a new issue