Download presentation

Presentation is loading. Please wait.

Published byBrycen Wombles Modified over 2 years ago

1
Impossibilities for Disjoint-Access Parallel Transactional Memory : Alessia Milani [Guerraoui & Kapalka, SPAA 08] [Attiya, Hillel & Milani, SPAA 09]

2
Transactional Synchronization A transaction is a sequence of operations by a single process on a set of shared data items (data set) to be executed atomically Like in database systems A transaction ends either by committing all of its updates take effect or by aborting no update is effective Read X Write X Read Z Read Y ABORT

3
33 Implementing Transactional Memory in Software Data representation for transactions and data items ---------------- ---------------- ---------------- ------- base obj High-level operations on data items Low-level primitives operations (read, write, CAS…) on base objects (memory locations) Algorithms

4
44 TM must provide Serializability [Papadimitriou, 1979] Any interleaving of the transactions yields a result that can be achieved in a sequential execution of the same set of transactions (a serialization) Strict Serializability [Papadimitriou, 1979] … and the serialization must preserve the real-time order of (non-overlapping) transactions

5
Inherent Limitations on TMs 5 DAP : Disjoint Access Parallelism T1 Read(Y) Write(X1) T2 Write(X2) Disjoint data sets no contention T1 T2 Improves scalability for large data structures by reducing interference T1 T2T2 Read(X2) Read(X1) T3T3 X1 X2 T3 Data sets are connected may contend

6
66 Inherent Limitations on TMs 6 DAP : More Formally An STM implementation is disjoint access parallel if two transactions T1 and T2 contend on the same base object ONLY IF the data sets of T1 and T2 are connected The data sets of T1 and T2 either intersect or are connected via other transactions Concurrently execute a low-level operation [Israeli & Rappaport, 1994]

7
[Guerraoui & Kapalka, SPAA 08] Strict Disjoint Access Parallelism Two transactions conflict on a low level base object only if their data sets intersect T1 and T2 cannot contend on a same base object T1 Read(Y) Write(X1) T2 Write(X2) T1 T2 T1 T2T2 Read(X2) Read(X1) T3T3 X1 X2 T3 Contend on the base object and one operation writes into it

8
Strict DAP versus DAP Allows read-read contention for not connected transactions But indirectly connected transactions cannot conflict

9
99 9 An impossibility The proof is by contradiction Theorem. No obstruction free TM is Strictly Disjoint Access Parallel [Guerraoui & Kapalka, SPAA 08]

10
By contradiction Assume a strictly DAP obstruction free TM exists T1 runs solo commits (obstruction freedom) Before s : x and y both equal 0 After s : y =1 s T1 Read(w)0, Read(z)0 Write(x,1), Write(y,1) T1 Cmt

11
Proof T1 Read(w)0, Read(z)0 Write(x,1), Write(y,1) T1 s T2T2 Read(x)0,Write(w,1) Cmt Before s : x and y both equal 0 After s : y =1 T2 runs solo commits (obstruction freedom)

12
Proof Before s : x and y both equal 0 After s : at least one between x and y is equal 1 T2 and T3 have disjoint data set T2 “invisible” to T3 (strictly DAP) T3 reads y equal 1 T3 runs solo should commit (obstruction freedom) T1 Read(w)0, Read(z)0 Write(x,1), Write(y,1) T1 T2T2 T3T3 Read(x)0,Write(w,1) Read(y)1,Write(z,1) s Cmt

13
Completing the Proof If T1 commits, the execution is not serializable because of the read by T2, but If T1 does not commit, the execution is not serializable because of the read by T3 T1 Read(w)0, Read(z)0 Write(x,1), Write(y,1) T1 T2T2 T3T3 Read(x)0,Write(w,1) Read(y)1,Write(z,1) s Cmt Contradiction to the existence of a strict DAP obstruction free TM

14
1414 14 …with Disjoint Access Parallel Previous theorem does not hold In fact…DAP can be ensured by an obstruction free TM implementation DSTM [Herlihy, Luchangco, Moir & Scherer]

15
1515 Inherent Limitations on TMs 15 Optimizing for Read-Only Transactions Transactions that only observe the data Empty write set Be invisible (not write to base objects) Avoid contention for the memory Always terminate successfully (wait-free)

16
1616 Inherent Limitations on TMs 16 Optimizing for Read-Only Transactions Transactions that only observe the data Empty write set Be invisible (not write to base objects) Avoid contention for the memory Always terminate successfully (wait-free)

17
17 Some Known STMs… Wait-free Read-only Tx Invisible read-only Tx DAPAlgorithm [DSTM-Herlihy, Luchangco, Moir & Scherer] [TLC-Avni & Shavit] [LSA-Riegel, Felber & Fetzer]

18
1818 Inherent Limitations on TMs 18 Inherent Tradeoff The proof relies on the notion of flippable execution, originally presented to prove lower bounds for atomic snapshot objects [Israeli & Shirazi] [Attiya, Ellen & Fatourou] Theorem. There is no TM implementation that is DAP and has invisible and wait-free read-only transactions

19
1919 Flippable Execution w/ 2 Updaters p1 p2 q s1 … sl-1 sl … sk U1 … Ul … U0 … Ul-1 … Uk Ek A read-only transaction by q that reads X1, X2 A complete transaction in which p1 writes l-1 to X1

20
2020 20 Flippable Execution w/ 2 Updaters Indistinguishable from executions where the order of (each pair of) consecutive updates is flipped…either forward or backward p1 p2 q s1 … sl-1 sl … sk U1 … Ul … U0 … Ul-1 … Uk Ek

21
Flippable Execution: Backward Flip p1 p2 q s1 … sl-1 sl … sk U1 … Ul … U0 … Ul-1 … Uk Ek p1 p2 q s1 … sl-1 sl … sk U1 … Ul … U0 … Ul-1 … Uk Fk Backward flip

22
2222 Inherent Limitations on TMs 22 Lemma 1. In a flippable execution the read- only transaction cannot terminate successfully Relies on Strict Serializability

23
2323 Inherent Limitations on TMs 23 Serialization of Ek Serialization point p1 p2 q s1 … sl-1 sl … sk U1 … Ul … U0 … Ul-1 … Uk Ek Returns (l-1,l-2) U1 … Ul …U0 Ul-1 Uk Serialization of Ek

24
Nowhere to Serialize U1 … Ul …U0 Ul-1 Uk Serialization of Ek p1 p2 q s1 … sl-1 sl … sk U1 … Ul … U0 … Ul-1 … Uk Ek Returns (l-1,l-2) p1 p2 q s1 … sl-1 sl … sk U1 … Ul … U0 … Ul-1 … Uk Backward flip Still returns (l-1,l-2) x X1 = l-3 X2= l-2 U1 … Ul …U0 Ul -1 Uk Serialization of Fk x X1 = l-3 X2= l X1 = l-1 X2= l x Fk

25
2525 25 Constructing a Flippable Execution Lemma 2. In a DAP TM, two consecutive transactions writing to different data items do not contend on the same base object

26
2626 26 Proof of Lemma 2 By contradiction assume that U1 and U2 contend on a same base object o is the last base object written by U1 that U2 accesses U1 Last write to o 11 11 U2 First access to o 22 22 p1 p2

27
Proof of Lemma 2 Overlapping execution of U1 and U2 U1 and U2 have disjoint data sets & contend on a base object U1 U2 11 11 22 22 p1 p2 U1 Last write to o 11 11 U2 First access to o 22 22 p1 p2 Not a DAP Implementation Serial execution of U1 and U2

28
2828 Inherent Limitations on TMs 28 A flippable execution exists The steps of the read-only transaction can be removed (since it is invisible) Since their data sets are disjoint, transactions Ul & Ul-1 do not “communicate” (by Lemma 2) Can be flipped

29
2929 Inherent Limitations on TMs 29 Completing the Proof By Lemma 1, the read-only transaction cannot terminate successfully If aborts, we can apply the same argument again…

30
Also a lower bound In a strict serializable DAP TM, where read- only transactions are wait-free, a transaction with a data set of size t must write to t-1 base objects

31
Weaker Liveness Condition If a transaction runs alone from a quiescent configuration then it terminates successfully Obstruction-freedom A transaction (eventually) running solo, terminates successfully Weakly progressiveness OUR RESULTS STILL HOLD

32
Weaker TM Consistency OUR RESULTS STILL HOLD Serializability Snapshot Isolation Causal Consistency Causal Serializability OPEN PROBLEM

33
Weakening DAP Our impossibility result still holds when considering a weaker notion of DAP that allows read-read contention (not connected transactions can read a same base object) T1 and T2 can read a same base object

34
3434 To summarize Theorem. There is no TM implementation that is DAP and has invisible and wait-free read-only transactions Theorem. No obstruction free TM is Strictly DAP

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google