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 3ad385a..22ebcf7 100644 --- a/Concurrent Systems/notes/3b - Aravind's algorithm and improvements.md +++ b/Concurrent Systems/notes/3b - Aravind's algorithm and improvements.md @@ -93,7 +93,12 @@ lock(i) := - $p_n$ invokes lock alone, completes its CS and its new DATE is n -**Lemma 1:** Suppose we have $n$ processes, then $\not \exists p_{j} : DATE[j]=DATE[i] \forall i \in [0, n]$ +**Lemma 1:** Suppose we have $n$ processes, then $\not \exists p_{j} : DATE[j]=DATE[i] \forall i \in [0, n]$ (non esistono due processi con lo stesso valore per DATE) +*Proof:* +- Suppose $p_j$ is the last process to execute unlock, then `DATE[j] = n` and for each i, `DATE[i] < n`, as DATE is either set to $n$ or decreased. +- by iterating this reasoning, it is clear that until every DATE is > 0, we have no processes with the same value for DATE. +- What if we reach 0? + - Let's suppose that $p_i$ is the first process that reaches `DATE = 0` **Lemma 2:** DATE's bounds are $[0, n]$ *Proof:*