1 © R. Guerraoui Universal constructions R. Guerraoui Distributed Programming Laboratory.

Slides:



Advertisements
Similar presentations
TWO STEP EQUATIONS 1. SOLVE FOR X 2. DO THE ADDITION STEP FIRST
Advertisements

You have been given a mission and a code. Use the code to complete the mission and you will save the world from obliteration…
1 Concurrency: Deadlock and Starvation Chapter 6.
Advanced Piloting Cruise Plot.
Chapter 1 The Study of Body Function Image PowerPoint
1 Copyright © 2010, Elsevier Inc. All rights Reserved Fig 2.1 Chapter 2.
By D. Fisher Geometric Transformations. Reflection, Rotation, or Translation 1.
Document #07-12G 1 RXQ Customer Enrollment Using a Registration Agent Process Flow Diagram (Switch) Customer Supplier Customer authorizes Enrollment.
Document #07-12G 1 RXQ Customer Enrollment Using a Registration Agent Process Flow Diagram (Switch) Customer Supplier Customer authorizes Enrollment.
Business Transaction Management Software for Application Coordination 1 Business Processes and Coordination.
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Title Subtitle.
Properties of Real Numbers CommutativeAssociativeDistributive Identity + × Inverse + ×
My Alphabet Book abcdefghijklm nopqrstuvwxyz.
Multiplying binomials You will have 20 seconds to answer each of the following multiplication problems. If you get hung up, go to the next problem when.
0 - 0.
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
SUBTRACTING INTEGERS 1. CHANGE THE SUBTRACTION SIGN TO ADDITION
MULT. INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
Addition Facts
Year 6 mental test 5 second questions
Year 6 mental test 10 second questions
ZMQS ZMQS
Solve Multi-step Equations
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 10 Arrays and Tile Mapping Starting Out with Games & Graphics.
Randomized Algorithms Randomized Algorithms CS648 1.
Data Structures: A Pseudocode Approach with C
FIFO Queues CSE 2320 – Algorithms and Data Structures Vassilis Athitsos University of Texas at Arlington 1.
ABC Technology Project
1 Undirected Breadth First Search F A BCG DE H 2 F A BCG DE H Queue: A get Undiscovered Fringe Finished Active 0 distance from A visit(A)
VOORBLAD.
Review Pseudo Code Basic elements of Pseudo code
Name Convolutional codes Tomashevich Victor. Name- 2 - Introduction Convolutional codes map information to code bits sequentially by convolving a sequence.
Quadratic Inequalities
1 Breadth First Search s s Undiscovered Discovered Finished Queue: s Top of queue 2 1 Shortest path from s.
Constant, Linear and Non-Linear Constant, Linear and Non-Linear
Factor P 16 8(8-5ab) 4(d² + 4) 3rs(2r – s) 15cd(1 + 2cd) 8(4a² + 3b²)
Squares and Square Root WALK. Solve each problem REVIEW:
© 2012 National Heart Foundation of Australia. Slide 2.
Lets play bingo!!. Calculate: MEAN Calculate: MEDIAN
Understanding Generalist Practice, 5e, Kirst-Ashman/Hull
Chapter 5 Test Review Sections 5-1 through 5-4.
GG Consulting, LLC I-SUITE. Source: TEA SHARS Frequently asked questions 2.
Addition 1’s to 20.
25 seconds left…...
Slippery Slope
Copyright © Cengage Learning. All rights reserved.
H to shape fully developed personality to shape fully developed personality for successful application in life for successful.
Januar MDMDFSSMDMDFSSS
Week 1.
We will resume in: 25 Minutes.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
PSSA Preparation.
Immunobiology: The Immune System in Health & Disease Sixth Edition
CpSc 3220 Designing a Database
Distributed Computing 9. Sorting - a lower bound on bit complexity Shmuel Zaks ©
Impossibility of Consensus in Asynchronous Systems (FLP) Ali Ghodsi – UC Berkeley / KTH alig(at)cs.berkeley.edu.
Distributed Computing 5. Snapshot Shmuel Zaks ©
Traktor- og motorlære Kapitel 1 1 Kopiering forbudt.
Secret Sharing, Matroids, and Non-Shannon Information Inequalities.
1 © R. Guerraoui The Limitations of Registers R. Guerraoui Distributed Programming Laboratory.
N-Consensus is the Second Strongest Object for N+1 Processes Eli Gafni UCLA Petr Kuznetsov Max Planck Institute for Software Systems.
1 © R. Guerraoui Set-Agreement (Generalizing Consensus) R. Guerraoui.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Presentation transcript:

1 © R. Guerraoui Universal constructions R. Guerraoui Distributed Programming Laboratory

2 Universality [Her91] Definition 1 : A type T is universal if, together with registers, instances of T can be used to provide a wait-free linearizable implementation of any other type (with a sequential specification) Definition 2: The implementation is called a universal construction

3 Consensus Theorem 1: Consensus is universal [Her91] Corollary 1: Compare&swap is universal Corollary 2: Queue is universal in a system of 2 processes (it has consensus number 2) Corollary to FLP/LA: Register is not universal in a system of at least 2 processes

4 Shared memory model Registers (read-write) + Consensus objects P2 P3 P1

5 The consensus object One operation propose() which returns a value. When a propose returns, the process decides Agreement: No two processes decide differently Validity: Every decided value is a proposed value Termination (wait-free): Every correct process that proposes a value eventually decides

6 Universality We consider first deterministic objects and then non-deterministic ones An object is deterministic if the result and final state of any operation depends solely on the initial state and the arguments of the operation

7 Example (FIFO Queue) Sequential deterministic specification P1 Enq(2) Deq() -> 1 Q Q P0 Q Enq(1)Deq() -> 2 Q

8 Example (Set) Sequential non-deterministic specification P1 Insert(2)Remove() -> 1 or 2 Q Q P0 Q Insert(1) Q Remove() -> 1 or 2

9 Universal construction (1) We assume a deterministic object We give an algorithm where every process has a copy of the object (inherent for wait-freedom) processes communicate through registers and consensus objects (linearizability)

10 P1 Enq(2) Q Q P0 Q Q Enq(1) Example (FIFO Queue) Non-linearizable execution Deq() -> 2 Deq() -> 1

11 Universal algorithm (1) P1 Read() Prop() Reg Cons P0 ConsReg Write(x) Prop()

12 Shared objects The processes share an array of n SWMR registers Lreq (theoretically of infinite size) This is used to inform all processes about which requests need to be performed

13 Shared objects The processes also share a consensus list Lcons (also of infinite size) This is used to ensure that the processes agree on a total order to perform the requests (on their local copies) We use an ordered list of consensus objects Every such object is uniquely identified by an integer Every consensus object is used to agree on a set of requests (the integer is associated to this set)

14 Universal algorithm (1) The algorithm combines the shared registers Lreq[I] and the consensus object list Lcons to ensure that: Every request invoked by a correct process is performed and a result is eventually returned (wait-free) Requests are executed in the same total order at all processes (i.e., there is a linearization point) This order reflects the real-time order (the linearization point is within the interval of the operation)

15 Linearization (FIFO Queue) Enq(2)Deq() -> 1 QQ Q Q Enq(1) Deq() -> 2

16 Local data structures Every process also uses two local data structures: A list of requests that the process has performed (on its local copy): lPerf A list of requests that the process has to perform: lInv Every request is uniquely identified

17 Universal algorithm (1) Every process pI executes three // tasks: Task 1: whenever pI has a new request, pI adds it to Lreq[I] Task 2: periodically, pI adds the new elements of every Lreq[J] into lInv Task 3: while (lInv – lPerf) is not empty, pI performs requests using Lcons

18 Task 3 While lInv – lPerf is not empty l pI proposes lInv – lPerf for a new consensus in Lcons (increasing the consensus integer) l pI performs the requests decided (that are not in Lperf) on the local copy l For every performed request: pI returns the result if the request is in Lreq[I] pI puts the request in lPerf

19 Example (FIFO Queue) P1 P0 Cons1 Enq(1) Enq(2)Deq() -> 1 Deq() -> 2 Cons2 Cons3 Cons4

20 Correctness Lemma 1 (wait-free): every correct process pI that invokes req eventually returns from that invocation Proof (sketch): Assume by contradiction that pI does not return from that invocation; pI puts req into Lreq (Task 1); eventually, every proposed lInv - lPerf contains req (Task 2); and the consensus decision contains req (Task 3); the result is then eventually returned (Task 3)

21 Correctness Lemma 2 (order): the processes execute the requests in the same total order Proof (sketch): the processes agree on the same total order for sets of requests and then use the same order within every set of requests (the linearization order is determined by the integers associated with the consensus)

22 Correctness Lemma 3 (real-time): if a request req1 precedes in real-time a request req2, then req2 appears in the linearization after req1 Proof (sketch): it directly follows from the algorithm that the result of req2 is based on the state of req1

23 Universality (1 + 2) We consider first deterministic objects and then non-deterministic ones An object is non-deterministic if the result and final state of an operation might differ even with the same initial state and the same arguments

24 Example (Set) P1 P0 Cons1 Cons2 Cons3 Insert(1) Insert(2) Remove() -> 1 Cons3 Remove() -> 2 Cons4 Remove() -> 1 Cons4 Remove() -> 2

25 Non-linearization Insert(2)Remove() -> 1 SS S S Insert(1)Remove() -> 1

26 A restricted deterministic type Assume that a non-deterministic type T is defined by a relation that maps each state s and each request o to a set of pairs (s,r), where s is a new state and r is the returned result after applying request o to an object of T in state s. Define a function as follows: For any s and o, (s,o) (s,o). The type defined by is deterministic

27 It is sufficient to implement a type defined by ! Every execution of the resulting (deterministic) object will satisfy the specification of T. P1 P0 Cons1 Cons2 Cons3 Insert(1) Insert(2) Remove() -> 1 Cons3 Remove() -> 1 Cons4 Remove() -> 2 Cons4 Remove() -> 2

28 Task 3 (Preserving non-determinism) While lInv – lPerf is not empty l pI produces the reply and new state (update) from request by performing: (reply,update):= object.exec(request) l pI proposes (request,reply,update) to a new consensus in Lcons (increasing the consensus integer) producing (re,rep,up) l pI updates the local copy: object.update(up) l pI returns the result if the request is in Lreq[I] l pI puts (req,rep,up) in lPerf