designing modeling and optimizing transactional data
play

Designing, Modeling, and Optimizing Transactional Data Structures - PowerPoint PPT Presentation

Designing, Modeling, and Optimizing Transactional Data Structures PhD Dissertation Defense Ahmed Hassan Electrical and Computer Engineering Department Virginia Tech September 1, 2015 State of the Art Multi-core architectures.


  1. OTB's Three Guidelines ● G3: Optimize Specific to each data structure. – ● Our Contribution: Linked-list-based Set. – Skip-list-based Set. – Skip-list-based Priority Queue. – Balanced Tree –

  2. Lazy Vs Boosting Vs Optimistic Boosting 48

  3. Example Example Bootsing “lazy” concurrent linked list Bootsing “lazy” concurrent linked list

  4. OTB Methodology Non-optimized Optimized Transactional Transactional Concurrent G1 & G2 G3 Data Structure General Specific 50

  5. Example  Lazy Linked list (Insert “55”) 50 60 70 2 5 10 51

  6. Example  Lazy Linked list (Insert “55”) 50 60 70 2 5 10  Traversal (unmonitored) 52

  7. Example  Lazy Linked list (Insert “55”) 50 60 70 2 5 10  Traversal (unmonitored)  Validation 53

  8. Example  Lazy Linked list (Insert “55”) X 50 60 70 2 5 10  Traversal (unmonitored) 55  Validation  Commit 54

  9. To Make it Transactional  Results of traversal are saved in local objects: Semantic read-set: to be validated. – Semantic write-set: to be published at commit. –

  10. To Make it Transactional Example: Linked list (Insert “55”)  2 5 10 50 60 70

  11. To Make it Transactional Example: Linked list (Insert “55”)  2 5 10 50 60 70 read-set ● Pred:50, curr:60 entry write-set ● Pred:50, curr:60, new:55 entry

  12. To Make it Transactional Example: Linked list (Insert “55”)  2 5 10 50 60 70 read-set ● Pred:50, curr:60 entry write-set ● Pred:50, curr:60, new:55 entry Guidelines to guarantee opacity (see OPODIS'14 paper) 

  13. Specific Optimizations  Example optimizations on Linked-List and Skip-List Local elimination: – Ex. Add(x) then Remove(x). ● No need to access the shared data structure. ●

  14. Results Skip-list 512 Nodes Skip-list 64K Nodes 5 ops/transaction 5 ops/transaction 60

  15. Transactional Interference-less Balanced Tree Transactional Interference-less Balanced Tree

  16. Transactional Interference-less Balanced Trees ● Transactional: Functionality (following OTB's G1, G2). ● Interference-less: Performance (following OTB's G3).

  17. The Next Question ● Which concurrent balanced tree design fits OTB?

  18. The Next Question ● Which concurrent balanced tree design fits OTB? Contention-Friendly Tree Crain, Gramoli, & Raynal'13

  19. CF-Tree ● Example: Insert 30. 10 10 20 20 20 30 10 30

  20. CF-Tree ● Example: Insert 30. 10 10 20 20 20 30 10 30 {10, 20} {10, 20, 30} {10, 20, 30}

  21. CF-Tree ● Example: Insert 30. 10 10 20 20 20 30 10 30 Semantic Structural {10, 20} {10, 20, 30} {10, 20, 30}

  22. CF-Tree ● Example: Insert 30. Application Thread Helper Thread 10 10 20 20 20 30 10 30 Semantic Structural {10, 20} {10, 20, 30} {10, 20, 30}

  23. Our Proposal Transactionalizing CF-Tree using OTB (TxCF-Tree)

  24. TxCF-Tree Application Thread Helper Thread 10 10 20 20 20 30 10 30

  25. TxCF-Tree Application Thread Helper Thread 10 10 20 20 20 30 10 30

  26. TxCF-Tree Application Thread 10 20

  27. TxCF-Tree Application Thread unmonitored traversal 10 20

  28. TxCF-Tree Application Thread unmonitored traversal 10 Lock & 20 Validate

  29. TxCF-Tree Application Thread unmonitored traversal 10 Lock & 20 Validate Insert 30

  30. TxCF-Tree Application Thread Traversal unmonitored traversal 10 Lock & Commit 20 Validate Insert 30

  31. Remove is similar... Application Thread Helper Thread 10 10 10 20 20(d) 30 30 30 Semantic Structural {10, 20, 30} {10, 20} {10, 20}

  32. Remove is similar... Application Thread Helper Thread 10 10 10 20 20(d) 30 30 30 Semantic Structural {10, 20, 30} {10, 20} {10, 20}

  33. Remove is similar... Application Thread Traversal unmonitored 10 traversal 20(d) Lock & Commit Validate 30 Mark as “d”

  34. Transactional Interference-less Tree

  35. Transactional Interference-less Tree ● How Step 1: CF-Tree!! – Step 2: Always give the highest priority to semantic operations over – structural operations.

  36. Transactional Interference-less Tree ● How Step 1: CF-Tree!! – Step 2: Always give the highest priority to semantic operations over – structural operations. ● Why Aborting transactions rolls back all its operations (including the – non-conflicting ones). Long transactions are more prone to interfere with the helper thread. –

  37. Two building blocks ● Structural Locks. ● Structural Invalidation.

  38. Structural Locks

  39. Structural Locks ● Transaction T1 wants to delete 30. ● after traversal and before commit, assume 2 scenarios A concurrent rotation A concurrent delete(30) 10 10 20 20 30 30

  40. Structural Locks ● Transaction T1 wants to delete 30. ● after traversal and before commit, assume 2 scenarios A concurrent rotation A concurrent delete(30) 10 10 20 20 30 30

  41. Structural Locks ● Transaction T1 wants to delete 30. ● after traversal and before commit, assume 2 scenarios A concurrent rotation A concurrent delete(30) 10 10 20 20 30 30 T1 observes that “30” is locked What is the best to do in both cases?

  42. Structural Locks ● Transaction T1 wants to delete 30. ● after traversal and before commit, assume 2 scenarios A concurrent rotation A concurrent delete(30) 10 10 20 20 Do Nothing Abort 30 30 T1 observes that “30” is locked What is the best to do in both cases?

  43. Structural Locks ● Transaction T1 wants to delete 30. ● after traversal and before commit, assume 2 scenarios A concurrent rotation A concurrent delete(30) 10 10 20 20 30 30 Solution?

  44. Structural Locks ● Transaction T1 wants to delete 30. ● after traversal and before commit, assume 2 scenarios A concurrent rotation A concurrent delete(30) Structural 10 10 Locks 20 20 Semantic Lock 30 30 Solution? Two types of locks

  45. Structural Invalidation

  46. Structural Invalidation ● Transaction T1 wants to insert 15. ● after traversal and before commit, assume 2 scenarios A concurrent rotation A concurrent insert(15) 10 10 20 20 30 30

  47. Structural Invalidation ● Transaction T1 wants to insert 15. ● after traversal and before commit, assume 2 scenarios A concurrent rotation A concurrent insert(15) 10 20 30 10 20 30 15

  48. Structural Invalidation ● Transaction T1 wants to insert 15. ● after traversal and before commit, assume 2 scenarios A concurrent rotation A concurrent insert(15) 10 20 30 10 20 30 15 T1 observes that the right child of “20” is not NULL What is the best to do in both cases?

  49. Structural Invalidation ● Transaction T1 wants to insert 15. ● after traversal and before commit, assume 2 scenarios A concurrent rotation A concurrent insert(15) 10 20 30 10 20 Continue Abort Traversal 30 15 T1 observes that the right child of “20” is not NULL What is the best to do in both cases?

  50. Structural Invalidation ● Transaction T1 wants to insert 15. ● after traversal and before commit, assume 2 scenarios A concurrent rotation A concurrent insert(15) 10 20 30 10 20 30 15 Solution?

  51. Structural Invalidation ● Transaction T1 wants to insert 15. ● after traversal and before commit, assume 2 scenarios A concurrent rotation A concurrent insert(15) 10 20 30 10 20 30 15 Solution? Continue Traversal anyway

  52. Evaluation AMD 64-cores, size 10K nodes, 50% reads, 5 ops/transaction

  53. Evaluation AMD 64-cores, size: 10K nodes , 32 threads, 50% reads, 5 ops/transaction

  54. Modeling Transactional Data Structures Modeling Transactional Data Structures

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend