diff --git a/Concurrent Systems/notes/Lezione2.md b/Concurrent Systems/notes/Lezione2.md index fdaf7d3..baece03 100644 --- a/Concurrent Systems/notes/Lezione2.md +++ b/Concurrent Systems/notes/Lezione2.md @@ -80,3 +80,21 @@ Let $p_i$ invoke lock esercizio: prova che NON soddisfa starvation freedom #### From deadlock freedom to bounded bypass +-> Round Robin algorithm + +Let DLF be any deadlock free protocol for MUTEX. Let's see how we can make it starvation free: + +``` +metti algoritmo qui +lock(i) := + FLAG[i] <- up + wait (TURN = i OR FLAG[TURN] = down) + DLF.lock(i) + return + +unlock(i) := + FLAG[i] <- down + if FLAG +``` + +