diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index 6b123ac..c14c921 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -4,7 +4,7 @@ "type": "split", "children": [ { - "id": "376bc91799eae4a7", + "id": "4c1f5b7a6abb1339", "type": "tabs", "children": [ { @@ -28,20 +28,36 @@ "type": "tabs", "children": [ { - "id": "51157f32453cba69", + "id": "e8fbc9b0750d5e3b", "type": "leaf", "state": { "type": "pdf", "state": { "file": "Concurrent Systems/slides/class 5.pdf", - "page": 7, + "page": 8, "left": -27, - "top": 68, + "top": 340, "zoom": 0.5754156769596199 }, "icon": "lucide-file-text", "title": "class 5" } + }, + { + "id": "51157f32453cba69", + "type": "leaf", + "state": { + "type": "pdf", + "state": { + "file": "Concurrent Systems/slides/class 6.pdf", + "page": 1, + "left": -34, + "top": 598, + "zoom": 0.4382422802850357 + }, + "icon": "lucide-file-text", + "title": "class 6" + } } ] } @@ -216,10 +232,11 @@ "companion:Toggle completion": false } }, - "active": "51157f32453cba69", + "active": "6edd4157a160e462", "lastOpenFiles": [ - "Concurrent Systems/notes/5 - Software Transactional Memory.md", "Concurrent Systems/slides/class 5.pdf", + "Concurrent Systems/notes/5 - Software Transactional Memory.md", + "Concurrent Systems/slides/class 6.pdf", "Concurrent Systems/notes/4c - Dining Philosophers.md", "Concurrent Systems/notes/4 - Semaphores.md", "Concurrent Systems/notes/4b - Monitors.md", @@ -248,7 +265,6 @@ "Pasted image 20250305182542.png", "HCIW/notes/1 - UX for IoT.md", "HCIW/exercises/Exercise.md", - "HCIW/exercises", "Concurrent Systems/notes/images/Pasted image 20250304082459.png", "Concurrent Systems/notes/images/Pasted image 20250304093223.png", "Concurrent Systems/notes/images/Pasted image 20250304090219.png", diff --git a/Concurrent Systems/notes/5 - Software Transactional Memory.md b/Concurrent Systems/notes/5 - Software Transactional Memory.md index 096d7b1..ccf2149 100644 --- a/Concurrent Systems/notes/5 - Software Transactional Memory.md +++ b/Concurrent Systems/notes/5 - Software Transactional Memory.md @@ -33,6 +33,7 @@ Implementation: every transaction uses a local working space #### A Logical Clock based STM system All the READs perform if no inconsistencies arise, or before any inconsistency +(definizioni in def qua sotto) >[!def] >Let T be a transaction; its read prefix is formed by all its successful READ before its possible abortion. @@ -108,18 +109,21 @@ VWC allows more transactions to commit -> it is a more liberal property than opa #### A Vector clock based STM system We have m shared MRMW registers; register X is represented by a pair XX, with: -- XX.val the current value of X -- XX.depend[1...m] a vector clock s.t. - - XX.depend[X] is the sequence number associated with the current value of X - - XX.depend[Y] is the sequence number associated with the value of Y on which the current value of X depends from +- `XX.val` the current value of X +- `XX.depend[1...m]` a vector clock s.t. + - `XX.depend[X]` is the sequence number associated with the current value of X + - corresponds to the `date` of the previous algorithm + - `XX.depend[Y]` is the sequence number associated with the value of Y on which the current value of X depends from - There is a starvation-free lock object associated to the pair -We have n processes; process $p_i$ has -- for every X, a local copy lc(XX) of the implementation of X -- $p\_depend_i[1…m]$ s.t. $p\_depend_i[X]$ is the seq.num. of the last val of X (directly or undirectly) known by $p_i$ +So for X, I don't just have to track "who modified X", but also "who modified "Y or Z", if they may have influenced X. -Every transaction T issues by pi has: -- read_set(T) and write_set(T) +We have n processes; process $p_i$ has +- for every X, a local copy `lc(XX)` of the implementation of X +- $p\_depend_i[1…m]$ s.t. $p\_depend_i[X]$ is the sequence number of the last val of X (directly or indirectly) known by $p_i$ + +Every transaction T issues by $p_i$ has: +- `read_set(T)` and `write_set(T)` - $t\_depend_{T}[1…m]$ a local copy of $p\_depend_i$ (this is used in the optimistic execution, not to change $p\_depend_{i}$ if T aborts) ``` diff --git a/Concurrent Systems/slides/class 6.pdf b/Concurrent Systems/slides/class 6.pdf new file mode 100644 index 0000000..16b7a6b Binary files /dev/null and b/Concurrent Systems/slides/class 6.pdf differ