vault backup: 2025-03-10 08:24:43
This commit is contained in:
parent
567655964f
commit
eeb4507fb4
5 changed files with 158 additions and 158 deletions
|
@ -136,4 +136,12 @@ It satisfies MUTEX and starvation freedom. It does not satisfy bounded bypass:
|
|||
- when the first process wakes up, it can pass to level 2 and eventually win
|
||||
- but the sleep can be arbitrary long and in the meanwhile the other two processes may have entered an unbounded number of CSs
|
||||
|
||||
Easy to generalize to k-MUTEX.
|
||||
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:
|
||||
![[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.
|
||||
|
||||
But we can do better. Let's see an idea of a constant-time algorithm.
|
Loading…
Add table
Add a link
Reference in a new issue