vault backup: 2025-03-10 09:04:43

This commit is contained in:
Marco Realacci 2025-03-10 09:04:43 +01:00
parent 43792673c1
commit c848395597
2 changed files with 19 additions and 2 deletions

View file

@ -36,7 +36,7 @@
"file": "Concurrent Systems/slides/class 3.pdf", "file": "Concurrent Systems/slides/class 3.pdf",
"page": 7, "page": 7,
"left": -27, "left": -27,
"top": 562, "top": 250,
"zoom": 0.5754156769596199 "zoom": 0.5754156769596199
}, },
"icon": "lucide-file-text", "icon": "lucide-file-text",

View file

@ -115,5 +115,22 @@ A **MRSW Safe register** is a register that provides READ and WRITE such that:
2. a READ that overlaps with a WRITE can return **any possible value** (of the register domain). 2. a READ that overlaps with a WRITE can return **any possible value** (of the register domain).
A **MRMW Safe register** behaves like a MRSW safe register, when WRITE operations do not overlap. Otherwise, in case of overlapping WRITEs, the register can contain any value (of the register domain). A **MRMW Safe register** behaves like a MRSW safe register, when WRITE operations do not overlap. Otherwise, in case of overlapping WRITEs, the register can contain any value (of the register domain).
*(Ci sta comunque lo stesso problema)*
This is the weakest type of register that is useful in concurrency. > Si chiama safe nel senso che se ci sono letture overlapping siamo safe. Ma è letteralmente l'unica cosa safe che abbiamo!
This is the weakest type of register that is useful in concurrency.
### Bakery Algorithm
**The idea is that**
- every process gets a ticket
- because we don't have atomicity, tickets may be not unique
- tickets can be made unique by pairing them with the process ID
- the smallest ticket (seen as a pair) grants the access to the CS
```
Initialize FLAG[i] to down and MY_TURN[i] to 0, for all i
lock(i) :=
FLAG[i] <- up
MY_TURN[i] <- M