
Concurrent Computing Rachid Guerraoui Petr Kuznetsov September 13, 2017 Contents 1. Introduction 9 1.1. A broad picture: the concurrency revolution . ............... 9 1.2. The topic: shared objects . ......... 10 1.3. Linearizability................................ ........ 11 1.4. Wait-freedom ................................... ..... 12 1.5. Combining linearizability and wait-freedom . ................ 12 1.6. Object implementation . ........ 13 1.7. Reducibility................................... ...... 14 1.8. Organization................................... ...... 14 1.9. Bibliographical notes . ......... 15 I. Correctness 17 2. Linearizability 19 2.1. Introduction ................................... ...... 19 2.2. ThePlayers ..................................... 20 2.2.1. Processes .................................... 20 2.2.2. Objects ...................................... 21 2.2.3. Histories .................................... 22 2.2.4. Sequential histories . ....... 23 2.2.5. Legalhistories ............................... 23 2.3. Linearizability................................ ........ 23 2.3.1. The case of complete histories . ........ 24 2.3.2. The case of incomplete histories . ......... 25 2.3.3. Completing a linearizable history . .......... 26 2.4. Composition.................................... ..... 27 2.5. Safety ......................................... 29 2.6. Summary ........................................ 31 2.7. Bibliographic notes . ........ 32 3. Progress 33 3.1. Introduction ................................... ...... 33 3.2. Implementation ................................. ...... 33 3.2.1. High-level and low-level objects . .......... 33 3.2.2. Zooming into histories . ...... 34 3.3. Progress properties . ........ 35 3.3.1. Variations................................... 36 3.3.2. Bounded termination . ..... 37 3.3.3. Liveness ..................................... 37 3.4. Linearizability and wait-freedom . ............. 37 3.4.1. Asimpleexample ............................... 37 3 3.4.2. A more sophisticated example . ....... 39 3.5. Summary ........................................ 40 3.6. Exercises ...................................... 41 II. Read-write objects 43 4. Simple register transformations 45 4.1. Definitions..................................... ..... 45 4.2. Proving register properties . ........... 46 4.3. Register transformations . .......... 48 4.4. Two simple bounded transformations . ............ 49 4.4.1. Safe/regular registers: from single reader to multiple readers . 49 4.4.2. Binary multi-reader registers: from safe to regular ................ 50 4.5. From binary to b-valued registers . 51 4.5.1. From safe bits to safe b-valued registers . 51 4.5.2. From regular bits to regular b-valued registers . 52 4.5.3. From atomic bits to atomic b-valued registers . 54 4.6. Bibliographic notes . ........ 56 4.7. Exercises ...................................... 56 5. Unbounded register transformations 57 5.1. 1W1R registers: From unbounded regular to atomic . ............... 57 5.2. Atomic registers: from unbounded 1W1R to 1WMR . ........... 58 5.3. Atomic registers: from unbounded 1WMR to MWMR . .......... 60 5.4. Concludingremark ............................... ...... 61 5.5. Bibliographic notes . ........ 61 5.6. Exercises ...................................... 61 6. Optimal atomic bit construction 63 6.1. Introduction ................................... ...... 63 6.2. Lowerbound ..................................... 63 6.2.1. Digests and sequences of writes . ........ 64 6.2.2. Impossibility result and lower bound . ........... 65 6.3. From three safe bits to an atomic bit . ........... 66 6.3.1. Base architecture of the construction . ............ 67 6.3.2. Handshaking mechanism and the write operation . ............ 67 6.3.3. An incremental construction of the read operation . ............... 68 6.3.4. Proof of the construction . ....... 71 6.3.5. Costofthealgorithms . ..... 74 6.4. Bibliographic notes . ........ 74 7. Atomic multivalued register construction 75 7.1. From single-reader regular to multi-reader atomic . .................. 75 7.2. Using an atomic control bit . ......... 75 7.3. Thealgorithm................................... ..... 77 7.4. Bibliographic notes . ........ 81 7.5. Exercises ...................................... 81 4 III. Snapshot objects 83 8. Collects and snapshots 85 8.1. Collectobject .................................. ...... 85 8.1.1. Definition and implementation . ........ 85 8.1.2. A collect object has no sequential specification . .............. 86 8.2. Snapshotobject ................................. ...... 87 8.2.1. Definition.................................... 87 8.2.2. The sequential specification of snapshot . ............ 87 8.2.3. Non-blocking snapshot . ...... 88 8.2.4. Wait-free snapshot . ..... 91 8.2.5. The snapshot object construction is bounded wait-free .............. 92 8.2.6. The snapshot object construction is atomic . ............ 93 8.3. Bounded atomic snapshot . ........ 94 8.3.1. Double collect and helping . ....... 94 8.3.2. Binary handshaking . 95 8.3.3. Bounded snapshot using handshaking . ......... 95 8.3.4. Correctness .................................. 95 8.4. Bibliographic notes . ........ 97 9. Immediatesnapshotanditeratedimmediatesnapshot 99 9.1. Immediatesnapshots . ....... 99 9.1.1. Definition.................................... 99 9.1.2. Blockruns .................................... 100 9.1.3. A one-shot implementation . .......100 9.2. Fastrenaming................................... 102 9.2.1. Snapshot-based renaming . 103 9.2.2. IS-basedrenaming . 103 9.3. Long-lived immediate snapshot . ...........106 9.3.1. Overview of the algorithm . 106 9.3.2. Proof of correctness . 106 9.4. Iterated immediate snapshot . ..........106 9.4.1. An equivalence between IIS and read-write . ...........107 9.4.2. Geometric representation of IIS . .........110 IV. Consensus objects 113 10.Consensus and universal construction 115 10.1. Consensus object: specification . .............115 10.2. A wait-free universal construction . ..............116 10.2.1. Deterministic objects . ........116 10.2.2. Bounded wait-free universal construction . ..............118 10.2.3. Non-deterministic objects . .........119 10.3. Bibliographic notes . .........119 11.Consensusnumberandtheconsensushierarchy 121 11.1.Consensusnumber ..... ...... ..... ...... ...... ... 121 5 11.2. Preliminary definitions . ..........121 11.2.1. Schedule, configuration and valence . ...........121 11.2.2. Bivalent initial configuration . ...........122 11.2.3. Critical configurations . ........123 11.3. Consensus number of atomic registers . .............124 11.4. Objects with consensus numbers 2 .............................125 11.4.1. Consensus from test&set objects .........................125 11.4.2. Consensus from queue objects ..........................126 11.4.3. Consensus numbers of test&set and queue ....................127 11.5. Objects of n-consensus type ...............................128 11.6. Objects whose consensus number is +∞ ..........................129 11.6.1. Consensus from compare&swap objects . ..........129 11.6.2. Consensus from augmented queue objects . ...........130 11.7. Consensus hierarchy . ........130 V. Schedulers 133 12.Failure detectors 135 12.1. Solving problems with failure detectors . ...............135 12.1.1. Failure patterns and failure detectors . ..............135 12.1.2. Algorithms using failure detectors . ............136 12.1.3.Runs ........................................ 137 12.1.4.Consensus ................................... 137 12.1.5. Implementing and comparing failure detectors . ..............137 12.1.6. Weakest failure detector . ........138 12.2. Extracting Ω .........................................138 12.2.1. Overview of the Reduction Algorithm . ..........138 12.2.2.DAGs........................................ 139 12.2.3. Asynchronous simulation . .......139 12.2.4.BG-simulation ... ...... ..... ...... ...... ..... 141 12.2.5.Usingconsensus .. ...... ..... ...... ...... ..... 142 12.2.6. Extracting Ω ....................................142 12.3. Implementing Ω in an eventually synchronous shared memory system . 145 12.3.1.Introduction..... ...... ..... ...... ...... .... 145 12.3.2. An omega construction . 145 12.3.3. Proof of correctness . 147 12.3.4.Discussion .................................. 148 12.4. Bibliographic Notes . .........148 13.Resilience 151 13.1. Pre-agreement with Commit-Adopt . ...........151 13.1.1. Wait-free commit adopt implementation . ............151 13.1.2. Usingcommit-adopt . 152 13.2. Safe Agreement and the power of simulation . ..............153 13.2.1. Solving safe agreement . .......153 13.2.2.BG-simulation ... ...... ..... ...... ...... ..... 154 13.3. Bibliographic notes . .........155 6 14.Adversaries 157 14.1. Non-uniform failure models . ..........157 14.2.Background .................................... 159 14.2.1.Model....................................... 159 14.2.2.Tasks ....................................... 160 14.2.3. The Commit-Adopt protocol . .......160 14.2.4. The BG-simulation technique. .........161 14.3. Non-uniform failures in shared-memory systems . ................161 14.3.1. Survivor sets and cores . .......161 14.3.2.Adversaries ................................. 162 14.3.3. Failure patterns and environments . ...........162 14.3.4. Asymmetric progress conditions . ..........163 14.4. Characterizing superset-closed adversaries . ...................163 14.4.1. A topological
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages178 Page
-
File Size-