From d49c23ade6bc5c312d3b856a53c90463d56b368a Mon Sep 17 00:00:00 2001 From: Marco Realacci Date: Tue, 4 Mar 2025 09:09:45 +0100 Subject: [PATCH] vault backup: 2025-03-04 09:09:45 --- Concurrent Systems/notes/Lezione2.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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 +``` + +