Download presentation
Presentation is loading. Please wait.
1
Elastic Transactions Pascal Felber Vincent Gramoli Rachid Guerraoui
2
Regular Transactions Set implementation w/ sorted linked list (x < y < z) y y t t h h
3
Regular Transactions Set implementation w/ sorted linked list (x < y < z) y y t t h BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX insert(z) insert(x)
4
Regular Transactions Set implementation w/ sorted linked list (x < y < z) y t t h h BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX insert(z) insert(x)
5
Regular Transactions Set implementation w/ sorted linked list (x < y < z) y y t t h BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX insert(z) insert(x) x x
6
Regular Transactions Set implementation w/ sorted linked list (x < y < z) y y t h h BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX insert(z) insert(x) x x
7
Regular Transactions Set implementation w/ sorted linked list (x < y < z) y y t t h h BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX insert(z) insert(x) x x z z
8
Regular Transactions Set implementation w/ sorted linked list (x < y < z) y y t t h h BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX insert(z) insert(x) x x z z
9
Regular Transactions Set implementation w/ sorted linked list (x < y < z) y y t t h h BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX insert(z) insert(x) x x z z Both transactions DO NOT commit…
10
Regular Transactions Set implementation w/ sorted linked list (x < y < z) y y t t h h BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX insert(z) insert(x) x x z z None of these accesses depend on the execution of the other None of these accesses depend on the execution of the other …but both transactions COULD commit.
11
Large Data Structures Linked list Integer set 2 16 elements in avg.
12
Large Data Structures Linked list Integer set 2 16 elements in avg. 8-core Intel Xeon 1 operation / tx TinySTM (most efficient on μ-benchs AFAWK)
13
Static Cut Set implementation w/ sorted linked list
14
Static Cut Set implementation w/ sorted linked list BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX insert(z) insert(x)
15
Static Cut Set implementation w/ sorted linked list BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX insert(z) insert(x) Cut here
16
Static Cut Set implementation w/ sorted linked list BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX insert(z) insert(x) insert(z) BEGIN_TX R(h) R(y) R(t) W(y) END_TX
17
Static Cut Set implementation w/ sorted linked list BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX insert(z) insert(x) insert(z) BEGIN_TX R(h) R(y) R(t) W(y) END_TX Lost update issue [Valois 95]
18
Elastic Transactions An elastic transaction adjusts its size dynamically by cutting it into subsequences of accesses at runtime. The library programmer must use BEGIN_EL_TX to differentiate elastic and normal transactions. The application programmer does not have to care about whether elastic transactions are used.
19
Elastic Transaction Improvement WithoutWith
20
Elastic Transaction Improvement WithoutWith
21
Elastic Transaction Improvement WithoutWith
22
Elastic Transaction Improvement WithoutWith
23
Key Idea: Cutting transactions dynamically How do elastic transactions work? BEGIN_TX R(h) R(y) R(t) W(y) END_TX insert(z) May I cut the tx here?
24
Key Idea: Cutting transactions dynamically How do elastic transactions work? BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX insert(z) insert(x) Yes!
25
Key Idea: Cutting transactions dynamically How do elastic transactions work? BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX insert(z) insert(x) insert(z) BEGIN_TX R(h) R(y) R(t) W(y) END_TX No!
26
Key Idea: Cutting transactions dynamically How do elastic transactions work? BEGIN_TX R(h) R(y) ABORT END_TX BEGIN_TX R(h) R(y) W(h) END_TX insert(z) insert(x) insert(z) BEGIN_TX R(h) R(y) R(t) W(y) END_TX The elastic transaction aborts if there is no way to cut
27
How is a cut achieved? A cut of an elastic transaction e is well- formed if : BEGIN_EL_T X R(*) W(*) END_TX
28
How is a cut achieved? A cut of an elastic transaction e is well- formed if : all subsequences contain at least 2 operations BEGIN_EL_T X R(*) W(*) END_TX
29
How is a cut achieved? A cut of an elastic transaction e is well- formed if : all subsequences contain at least 2 operations all writes of e belong to the same sub- sequence BEGIN_EL_T X R(*) W(*) END_TX
30
How is a cut achieved? A cut of an elastic transaction e is well- formed if : all subsequences contain at least 2 operations all writes of e belong to the same sub- sequence all sub-sequences start with a read (unless e starts writing) BEGIN_EL_T X R(*) W(*) END_TX
31
How is a cut achieved? A cut of an elastic transaction e is consistent if all common elements accessed by two consecutive sub-sequences are not written.
32
How is a cut achieved? A cut of an elastic transaction e is consistent if all common elements accessed by two consecutive sub-sequences are not written. This avoids: R(x) R(y) W(x) W(y) NO R(x) W(x) NO
33
How is a cut achieved? A cut of an elastic transaction e is consistent if all common elements accessed by two consecutive sub-sequences are not written. This avoids: This allows: R(x) R(y) W(x) R(x) R(y) W(y) R(x) R(y) W(x) W(y) OK NO R(x) W(x) NO
34
Elastic-opacity: A history is elastic-opaque if there are consistent cuts such that replacing each elastic tx e by its resulting subsequences form an opaque history. Elastic Guarantees
35
Elastic Transaction Guarantees Elastic transactions: weaker than regular ones BEGIN_TX R(h) R(a) R(b) … W(z) END_TX delete(q) BEGIN_EL_TX R(h) R(a) R(b) … W(z) END_TX delete(q) Cut
36
Is there a limitation? Elastic tx apply to most common operations – In linked lists, skip lists, hash tables, red-black trees… Elastic tx apply to most common operations –Ex: delete(*)/search(*)/insert(*)/move(*,*)… Elastic tx do not apply to complex operations –sumAll() –conditionalWrite() z z y y t t x x h h
37
No! For complex operations, use regular transactions Both type of transactions combine safely sumAll() / conditionalWrite() z z y y t t x x h h BEGIN_EL_TX R(h) R(x) R(y) R(z) END_TX BEGIN_RL_TX R(h) R(x) R(y) R(z) R(t) END_TX search(z) sumAll()
38
Related Work Fine-grained locking: Efficient parsing of data structure Early release: Some reads may be forgotten (release() method) Commutative operations: High-level commutative ops do not conflict Boosting / Open nesting: Take effect before commit-time Abstract nesting: Partial roll-back mechanism
39
Related Work Fine-grained locking: Efficient parsing of data structure Does not support composition Early release: Some reads may be forgotten (release() method) Programmer must know when and what to release Commutative operations: High-level commutative ops do not conflict Static identification of commutative operations is too restrictive Boosting / Open nesting: Take effect before commit-time Complex roll-back mechanism must be defined Abstract nesting: Partial roll-back mechanism Minimize abort costs, not the amount of unnecessary aborts
40
Conclusion Elastic transaction New transactional model
41
Conclusion Elastic transaction New transactional model Easy-to-use Use BEGIN_EL_TX and END as delimiters in sequential code
42
Conclusion Elastic transaction New transactional model Easy-to-use Use BEGIN_EL_TX and END as delimiters in sequential code Composable Elastic and regular transactions are composable
43
Conclusion Elastic transaction New transactional model Easy-to-use Use BEGIN_EL_TX and END as delimiters in sequential code Composable Elastic and regular transactions are composable Efficient Speedup frequently executed operations
44
Conclusion Elastic transaction New transactional model Easy-to-use Use BEGIN_EL_TX and END as delimiters in sequential code Composable Elastic and regular transactions are composable Efficient Speedup frequently executed operations Future work Characterize the requirements to use elastic transactions
45
Thank you http://lpd.epfl.ch/gramoli/php/estm.php
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.