vault backup: 2025-04-04 23:39:27

This commit is contained in:
Marco Realacci 2025-04-04 23:39:27 +02:00
parent 6a9cf80167
commit 24539ddb11
13 changed files with 28 additions and 28 deletions

View file

@ -53,10 +53,10 @@ unlock(i) :=
**How has p0 entered its CS?**
a) `FLAG[1] = down`, this is possible only with the following interleaving:
![[images/Pasted image 20250303100721.png]]
![[/Concurrent Systems/notes/images/Pasted image 20250303100721.png]]
b) `AFTER_YOU = 1`, this is possible only with the following interleaving:
![[images/Pasted image 20250303100953.png]]
![[/Concurrent Systems/notes/images/Pasted image 20250303100953.png]]
##### Bounded Bypass proof (with bound = 1)
- If the wait condition is true, then it wins (and waits 0).
@ -140,7 +140,7 @@ Easy to generalize to k-MUTEX.
Peterson's algorithm cost $O(n^2)$
A first way to reduce this cost is by using a tournament of MUTEX between pairs of processes:
![[images/Pasted image 20250304082459.png|350]]
![[/Concurrent Systems/notes/images/Pasted image 20250304082459.png|350]]
Of course this is a binary tree, and the height of a binary tree is logaritmic to the number of leaves. A process then wins after $\lceil \log_{2}n \rceil$ competitions $\to O(\log n)$ cost.