On the Space Complexity of Colourless Tasks by Leqi Zhu A
Total Page:16
File Type:pdf, Size:1020Kb
On the Space Complexity of Colourless Tasks by Leqi Zhu A thesis submitted in conformity with the requirements for the degree of Doctor of Philosophy Graduate Department of Computer Science University of Toronto c Copyright 2019 by Leqi Zhu Abstract On the Space Complexity of Colourless Tasks Leqi Zhu Doctor of Philosophy Graduate Department of Computer Science University of Toronto 2019 In this thesis, we prove lower bounds on the number of registers needed to solve colourless tasks in asynchronous shared memory systems. Many fundamental synchronization tasks, such as consensus, k-set agreement, and -approximate agreement, are colourless. We show that it is possible to transform any nondeterministic solo-terminating algorithm (including any randomized wait-free algorithm) into an obstruction-free algorithm that uses the same number of registers. This result extends to algorithms using any finite number of deterministic objects that support read operations. Hence, we can focus on proving lower bounds for obstruction-free algorithms. We prove a tight lower bound on the number of registers needed to solve obstruction-free consensus. We also prove the first non-constant lower bounds on the number of registers needed to solve obstruction- free k-set agreement and obstruction-free -approximate agreement. The bound for k-set agreement is asymptotically tight when k is a constant and the bound for -approximate agreement is asymptotically tight when is sufficiently small. To prove these bounds, we introduce a new technique, revisionist simulations. This technique allows us to prove a general theorem that yields lower bounds on the number of registers needed to solve any colourless task in an obstruction-free manner. Finally, we define the class of extension-based proofs and show that no extension-based proof can establish the impossibility of deterministically solving k-set agreement among n > k > 1 processes in a wait-free manner using registers. ii In loving memory of my grandparents, 袁诚 and 王蕴华. iii Acknowledgements First and foremost, I would like to thank my advisor, Professor Faith Ellen. She has been extremely patient, helpful, and understanding with me throughout my graduate studies (especially in the writing of this thesis). On more than one occasion, I've half-jokingly remarked that she is like a second mother to me. This thesis and our papers together have undoubtedly benefited enormously from her selflessly spending hours and hours with me, carefully working on the exposition and proofs. Most importantly, she has imparted to me many lessons about life and research, which I will faithfully try to live up to, though I've always been a poor pupil..., I must also thank my friends and colleagues at the theory group: Sepehr, Jai, Suraj, Rob, Eric, Alex, Ksenija, Jeremy, Chris, Rati, Kevan, Mike, Lily, Calum (George), Rahim, Ian, James, Tyrone, Ammar, and Ximo. I am grateful to have met each and every one of you and I will fondly remember the many interesting conversations we shared. For other members of the theory group, it's a shame that our paths did not cross as often! Special thanks to Rati, for all the wonderful excursions (all done for the sake of research, of-course) and fun collaborations. I don't think I would have even considered walking this path, without the guidance of my parents, 朱 福民 and 袁晓芬. I am thankful for their love and support as well as their commitment to our biweekly family dinners together on the weekends, rain or shine. It was a comforting tradition. I also thank the members of my committee for taking the time to read this thesis and their great comments: Benjamin Rossman, Vassos Hadzilacos, Sergio Rajsbaum, and Sam Toueg. Support is also gratefully acknowledged from NSERC. Last, but not least, I would like to thank a certain mysterious stranger, who gave me some very nice gifts. Including, some might say, the greatest gift of all ,. iv Contents 1 Introduction 1 2 Preliminaries 6 2.1 Colourless Tasks . .6 2.2 Asynchronous Shared Memory . .7 2.2.1 Objects . .7 2.2.2 Processes . .8 2.2.3 The Scheduler . .9 2.3 Protocols . .9 2.4 Implementations . 10 2.5 General Progress Conditions . 10 2.6 Snapshots of Readable Objects . 11 3 Nondeterministic Solo-termination vs Obstruction-freedom 13 3.1 Related Work . 13 3.2 The Transformation . 14 3.2.1 Sketch . 14 3.2.2 Formal Description . 15 3.3 Proof of Correctness/Linearizability . 16 3.3.1 B is correct/linearizable . 16 3.3.2 B is obstruction-free . 16 4 Consensus 18 4.1 Related Work . 18 4.2 Buffer Lower Bound . 20 4.3 Buffer Upper Bound . 23 4.4 Test-and-Set Objects . 27 4.5 Max-Registers . 28 4.6 Swap Objects . 31 5 Augmented Snapshot Objects 35 5.1 Related Work . 35 5.2 Implementing block-update for a Single Process . 36 5.3 Simple Augmented Snapshot Object . 38 v 5.4 Augmented Snapshot Object . 40 5.5 Proof of Correctness and Termination . 43 6 Revisionist Simulations 48 6.1 Related Work . 48 6.2 Overview . 49 6.3 Direct Simulators and a Simple Case of the Simulation . 50 6.4 Covering Simulators . 53 6.5 The Intermediate Execution of a Real Execution . 57 6.6 Correctness of the Simulation . 58 6.7 Wait-freedom of the simulation . 62 6.8 Applications of the Simulation . 64 7 Why Extension-based Proofs Fail 66 7.1 Related Work . 66 7.2 Preliminaries . 67 7.2.1 NIIS Model . 67 7.2.2 Topological Representation of a Protocol . 69 7.2.3 Non-uniform Chromatic Subdivision . 70 7.2.4 Distances between Subcomplexes . 71 7.3 Restricted Extension-Based Proofs . 73 7.4 Why Restricted Extension-based Proofs Fail . 75 7.5 Extension-Based Proofs . 79 8 Conclusions and Future Work 83 vi Chapter 1 Introduction An asynchronous shared memory system consists of a finite number, n 2, of processes, running at ≥ possibly varying speeds, that can only communicate with each other by taking steps to access shared memory locations. Each memory location supports a set of operations that may be performed on it and each step by a process involves the process performing one such operation. Many modern multiprocessor computers are examples of asynchronous shared memory systems. A well-studied type of distributed problem is a task, where each process has a private input value and each process must produce a single output value such that, collectively, the output values satisfy the specifications of the task. A task is colourless if the input of any process may be the input of any other process, the output of any process may be the output of any other process, and the specifications of valid outputs only depends on the set of inputs of the processes. Many fundamental problems in distributed computing are colourless tasks. One example is the consensus problem, in which each process has a private input value and the processes must agree on a single input value to output. There are numerous applications of consensus, e.g. in synchronization, implementing shared data structures, and solving other tasks. Other examples of colourless tasks include the k-set agreement problem, for integers 1 k < n, which generalizes consensus so that the set of output ≤ values has size at most k, and the -approximate agreement problem, which requires any two output values are at most apart. All three problems have been the subject of much research. The goal of this thesis is to study, for various colourless tasks, the minimum number of memory locations needed to solve the task in an asynchronous shared memory system. We call this the space complexity of the task (in that system). The space complexity depends on the operations supported at the memory locations in the system. In this thesis, we primarily consider asynchronous shared memory systems where each memory lo- cation is a register, i.e. it supports only two operations: read, which allows the contents of the memory location to be read, and write(v), which writes value v to the memory location, for arbitrary values v. Our decision to focus on these systems is motivated by two considerations. First, modern architectures typically provide a fixed set of operations, including read and write, that may be performed on all mem- ory locations. Second, for many of the tasks we consider, there were large gaps in the upper and lower bounds on their space complexity, even in this simple setting. A solution to a task is wait-free if each process outputs a value after taking sufficiently many steps, regardless of what other processes do (even if they stop taking steps). Many tasks have no deterministic, 1 Chapter 1. Introduction 2 wait-free solutions in asynchronous systems containing only registers. In particular, one of the most well-known results in the theory of distributed computing is that there is no deterministic wait-free solution to consensus in this setting [31, 46]. There are many approaches to circumventing this impossibility result. One approach is to relax the circumstances in which a process must eventually output a value. For instance, a process may only be required to output a value after taking sufficiently many consecutive steps (without any other process interfering). This is called obstruction-freedom. Another way is to strengthen the system so that each process has access to a private source of randomness. In this case, each process is required to output a value after taking finitely many steps, with probability 1, regardless of what other processes do. Solutions satisfying this property are called randomized wait-free. The formal definition are presented in Chapter 2.