vault backup: 2025-03-10 23:28:03
This commit is contained in:
parent
e4e864a4e0
commit
668da058ec
3 changed files with 6 additions and 10 deletions
3
.obsidian/app.json
vendored
3
.obsidian/app.json
vendored
|
@ -1,3 +0,0 @@
|
||||||
{
|
|
||||||
"alwaysUpdateLinks": true
|
|
||||||
}
|
|
7
.obsidian/workspace.json
vendored
7
.obsidian/workspace.json
vendored
|
@ -51,8 +51,7 @@
|
||||||
"title": "class 3"
|
"title": "class 3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
"currentTab": 1
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"direction": "vertical"
|
"direction": "vertical"
|
||||||
|
@ -224,10 +223,10 @@
|
||||||
"companion:Toggle completion": false
|
"companion:Toggle completion": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"active": "dd6c003f9d17b0e9",
|
"active": "6edd4157a160e462",
|
||||||
"lastOpenFiles": [
|
"lastOpenFiles": [
|
||||||
"Concurrent Systems/slides/class 3.pdf",
|
|
||||||
"Concurrent Systems/notes/3b - Aravind's algorithm and improvements.md",
|
"Concurrent Systems/notes/3b - Aravind's algorithm and improvements.md",
|
||||||
|
"Concurrent Systems/slides/class 3.pdf",
|
||||||
"Concurrent Systems/notes/3a - Hardware primitives & Lamport Bakery algorithm.md",
|
"Concurrent Systems/notes/3a - Hardware primitives & Lamport Bakery algorithm.md",
|
||||||
"Concurrent Systems/notes/1 - CS Basics.md",
|
"Concurrent Systems/notes/1 - CS Basics.md",
|
||||||
"Concurrent Systems/notes/2b - Round Robin algorithm.md",
|
"Concurrent Systems/notes/2b - Round Robin algorithm.md",
|
||||||
|
|
|
@ -91,11 +91,11 @@ lock(i) :=
|
||||||
until foreach j != i, STAGE[j] = 0
|
until foreach j != i, STAGE[j] = 0
|
||||||
```
|
```
|
||||||
|
|
||||||
- $p_n$ invokes lock alone, completes its CS and its new DATE is n
|
- $p_n$ invokes lock alone, completes its CS and so `DATE[n] = n`
|
||||||
- all other $p_i, i \in P$ (with P being the set of all processes) will have `DATE[i] < n`, as their value for DATE is decreased
|
- then as DATE is either set to n or decreased, for each i, `DATE[i] < n`
|
||||||
- *scenario 1*: every other $p_i$ keep invoking lock again immediately after the unlock
|
- *scenario 1*: every other $p_i$ keep invoking lock again immediately after the unlock
|
||||||
- every time some process exits the CS, `DATE[n]` is decreased
|
- every time some process exits the CS, `DATE[n]` is decreased
|
||||||
- after $n-1$ turns, `DATE[n]` will have `DATE[n] = 1`, with every other `DATE[i] > 1, i!=n` -> ️✅
|
- after $n-1$ turns, `DATE[n]` will have `DATE[n] = 1`, with every other `DATE[i] > 1, i!=n` -> ️✅
|
||||||
- *scenario 2*: not every process invokes the lock
|
- *scenario 2*: not every process invokes the lock
|
||||||
- eventually, more than one process will have its DATE set to 0
|
- eventually, more than one process will have its DATE set to 0
|
||||||
- but there will still be at most $n-1$ processes $p_i$ with `DATE[i] < DATE[n]`, this ensures that after $n-1$ -> ✅
|
- but there will still be at most $n-1$ processes $p_i$ with `DATE[i] < DATE[n]`, this ensures that after $n-1$ steps, every other process $p_i$ will have `DATE[i] > DATE[n]` -> ✅
|
||||||
|
|
Loading…
Reference in a new issue