vault backup: 2025-03-17 10:04:23
This commit is contained in:
parent
e9f44190a2
commit
8e1ea33ab8
3 changed files with 18 additions and 11 deletions
11
.obsidian/workspace.json
vendored
11
.obsidian/workspace.json
vendored
|
@ -13,12 +13,12 @@
|
|||
"state": {
|
||||
"type": "markdown",
|
||||
"state": {
|
||||
"file": "Concurrent Systems/notes/4b -.md",
|
||||
"file": "Concurrent Systems/notes/4c - Dining Philosophers.md",
|
||||
"mode": "source",
|
||||
"source": false
|
||||
},
|
||||
"icon": "lucide-file",
|
||||
"title": "4b -"
|
||||
"title": "4c - Dining Philosophers"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -34,9 +34,9 @@
|
|||
"type": "pdf",
|
||||
"state": {
|
||||
"file": "Concurrent Systems/slides/class 4.pdf",
|
||||
"page": 16,
|
||||
"page": 17,
|
||||
"left": -27,
|
||||
"top": 130,
|
||||
"top": 78,
|
||||
"zoom": 0.5754156769596199
|
||||
},
|
||||
"icon": "lucide-file-text",
|
||||
|
@ -218,8 +218,9 @@
|
|||
},
|
||||
"active": "6edd4157a160e462",
|
||||
"lastOpenFiles": [
|
||||
"Concurrent Systems/notes/4b - Monitors.md",
|
||||
"Concurrent Systems/notes/4c - Dining Philosophers.md",
|
||||
"Concurrent Systems/slides/class 4.pdf",
|
||||
"Concurrent Systems/notes/4b -.md",
|
||||
"Concurrent Systems/slides/class 5.pdf",
|
||||
"HCIW/slides/4 HUI2016-6-forcefeedback.pdf",
|
||||
"HCIW/slides/3b Haptic slides.pdf",
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
### Monitors
|
||||
Semaphores are hard to use in practice because quite low level Monitors provide an easier definition of concurrent objects at the level of Prog. Lang.
|
||||
|
||||
It guarantees mutual exclusion.
|
||||
|
@ -152,8 +151,9 @@ operation begin_write() :=
|
|||
|
||||
operation end_write() :=
|
||||
AW--
|
||||
if WW > 0 then
|
||||
CW.signal()
|
||||
else
|
||||
if WR > 0 then
|
||||
CR.signal()
|
||||
else
|
||||
CW.signal()
|
||||
```
|
||||
This way nobody gets starved forever.
|
6
Concurrent Systems/notes/4c - Dining Philosophers.md
Normal file
6
Concurrent Systems/notes/4c - Dining Philosophers.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
The first real practical example of a concurrent system.
|
||||
|
||||
- $N$ philosophers seated around a circular table
|
||||
- one chopstick between each pair of philosophers
|
||||
- a philosophers must pick up its two nearest chopsticks in order to eat
|
||||
- a philosoph
|
Loading…
Add table
Add a link
Reference in a new issue