vault backup: 2025-04-04 23:58:09

This commit is contained in:
Marco Realacci 2025-04-04 23:58:09 +02:00
parent 8e517b1bd4
commit 1ce5aec8cd
13 changed files with 34 additions and 50 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:
![[/Concurrent Systems/notes/images/Pasted image 20250303100721.png]]
![](Concurrent%20Systems/notes/images/Pasted%20image%2020250303100721.png)
b) `AFTER_YOU = 1`, this is possible only with the following interleaving:
![[/Concurrent Systems/notes/images/Pasted image 20250303100953.png]]
![](Concurrent%20Systems/notes/images/Pasted%20image%2020250303100953.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:
![[/Concurrent Systems/notes/images/Pasted image 20250304082459.png|350]]
![350](Concurrent%20Systems/notes/images/Pasted%20image%2020250304082459.png|)
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.