diff --git a/Concurrent Systems/notes/3b - Aravind's algorithm and improvements.md b/Concurrent Systems/notes/3b - Aravind's algorithm and improvements.md index 302f1d7..c09f8cf 100644 --- a/Concurrent Systems/notes/3b - Aravind's algorithm and improvements.md +++ b/Concurrent Systems/notes/3b - Aravind's algorithm and improvements.md @@ -80,3 +80,14 @@ unlock(i) := Since the LOCK is like before, the revised protocol satisfies MUTEX. Furthermore, you can prove that it satisfies bounded bypass with bound n-1 -> EXERCISE! +Let's remember ourselves how is the locking function defined: +``` +lock(i) := + FLAG[i] <- up + repeat + STAGE[i] <- 0 + wait (foreach j != i, FLAG[j] = down OR DATE[i] < DATE[j]) + STAGE[i] <- 1 + until foreach j != i, STAGE[j] = 0 +``` +