1 / 17

Atomic Snapshots

Atomic Snapshots. data . Abstract Data Types. Abstract representation of data & set of methods ( operations ) for accessing it Implement u sing primitives on base objects . Correctness: Linearizability. [Herlihy & Wing, 1990]

twyla
Download Presentation

Atomic Snapshots

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Atomic Snapshots

  2. data Abstract Data Types • Abstract representation of data & set of methods (operations) for accessing it • Implement using primitives on base objects Introduction

  3. Correctness: Linearizability [Herlihy & Wing, 1990] • For every concurrent execution there is a sequential execution that • Contains the same operations • Is legal (obeys the specification of the ADTs) • Preserves the real-time order of non-overlapping operations • Each operation appears to takes effect instantaneously at some point between its invocation and its response (atomicity) Introduction

  4. Atomic Snapshot • n components • Update a single component • Scan all the components “at once” (atomically) Provides an instantaneous view of the whole memory update scan v1,…,vn ok Introduction

  5. Atomic Snapshot Algorithm [Afek, Attiya, Dolev, Gafni, Merritt, Shavit, JACM 1993] double collect Update(v,k) A[k] = v,seqi,i • Scan() • repeat • read A[1],…,A[n] • read A[1],…,A[n] • if equal • return A[1,…,n] • Linearize: • Updates with their writes • Scans inside the double collects Introduction

  6. read A[1],…,A[n] read A[1],…,A[n] write A[j] Atomic Snapshot: Linearizability Double collect (read a set of values twice) If equal, there is no write between the collects • Assuming each write has a new value (seq#) Creates a “safe zone”, where the scan can be linearized Introduction

  7. LivenessConditions • Wait-free: every operation completes within a finite number of (its own) steps • no starvation for mutex • Nonblocking: some operation completes within a finite number of (some other process) steps • deadlock-freedom for mutex • Obstruction-free: an operation (eventually) running solo completes within a finite number of (its own) steps • Also called solo termination wait-free  nonblocking  obstruction-free Introduction

  8. Wait-free Atomic Snapshot [Afek, Attiya, Dolev, Gafni, Merritt, Shavit, JACM 1993] • Embed a scan within the Update. Update(v,k) V = scan A[k] = v,seqi,i,V • Scan() • repeat • read A[1],…,A[n] • read A[1],…,A[n] • if equal • return A[1,…,n] • else record diff • if twice pj • return Vj direct scan • Linearize: • Updates with their writes • Direct scans as before • Borrowed scans in place borrowedscan Introduction

  9. embedded scan read A[j] read A[j] read A[j] read A[j] … … … … … … … … write A[j] write A[j] Atomic Snapshot: Borrowed Scans Interference by process pj And another one… • pjdoes a scan inbeteween Linearizing with the borrowed scan is OK. Introduction

  10. Complexity of Atomic Snapshots • Scan needs O(n2) reads and writes, why? • Update needs O(n2) reads and writes 236755 (2013) 04: R/W simulations

  11. O(nlogn) Atomic snapshots [Attiya, Rachman SIAM 1998] • n components • Scate- Update a single component and Scan all the components “at once” (atomically) Provides an instantaneous view of the whole memory scate v1,…,vn

  12. One-shot Atomic Snapshot • Each processes execute at most one scate operation. • The size of a view is the number of non-empty entries. scate v1,…,vn

  13. One-shot Atomic Snapshot • dominates, if for all , if then • unionof a set , denoted by is the view that dominates all views . scate v1,…,vn

  14. The ClassifierProcedure Localknowledge 1,1,1 Classifier(K,Ii) Write Ii to Ri Read R1,…, Rn If |{R1,…, Rn}|>K then read R1,…, Rn return Oi= {R1,…, Rn} Else return Oi= Ii K=2 Lemma: The output view of a righty dominates the union of the lefties outputs. dominating knowledge righties lefties Original knowledge

  15. Atomic Snapshot from Classifiers Classifier Classifier Classifier 1 3 n • Scate operation requires O(nlogn) operations on single-writer multireader registers.

  16. Atomic Snapshot from Classifiers • Operations are ordered in the leaves : • Operations arriving at different leaves are comparable. • Operations arriving at the same leaf have exactly the same final knowledge. Scate(val) Si=(val) For j=1 to n currenti,1[j]=Sj v=root For l=1 to log(n) currenti,l+1=Classifier(label(v),currenti,l) if righty then v = v.right if lefty then v = v.left Return currenti,log(n)+1 Lemma: Let be a scate operation that passes through a node with level then Lemma : Let OP be the set of scate operations that pass through a node with level then |OP|

  17. Linearization • The views returned by the scate operations are comparable and ordered at the leaves from left to right scan update 1 3 n

More Related