Software Transactional Memory for Dynamic-Sized Data Structures Maurice Herlihy, Victor Luchangco, Mark Moir, William Scherer Presented by: Gokul Soundararajan.

Slides:



Advertisements
Similar presentations
Software Transactional Objects Guy Eddon Maurice Herlihy TRAMP 2007.
Advertisements

Copyright 2008 Sun Microsystems, Inc Better Expressiveness for HTM using Split Hardware Transactions Yossi Lev Brown University & Sun Microsystems Laboratories.
Time-based Transactional Memory with Scalable Time Bases Torvald Riegel, Christof Fetzer, Pascal Felber Presented By: Michael Gendelman.
Optimistic Methods for Concurrency Control By : H.T. Kung & John T. Robinson Presenters: Munawer Saeed.
Impossibilities for Disjoint-Access Parallel Transactional Memory : Alessia Milani [Guerraoui & Kapalka, SPAA 08] [Attiya, Hillel & Milani, SPAA 09]
© 2005 P. Kouznetsov Computing with Reads and Writes in the Absence of Step Contention Hagit Attiya Rachid Guerraoui Petr Kouznetsov School of Computer.
Virendra J. Marathe, William N. Scherer III, and Michael L. Scott Department of Computer Science University of Rochester Presented by: Armand R. Burks.
Software Transactional Memory Kevin Boos. Two Papers Software Transactional Memory for Dynamic-Sized Data Structures (DSTM) – Maurice Herlihy et al –
Pessimistic Software Lock-Elision Nir Shavit (Joint work with Yehuda Afek Alexander Matveev)
Parallel Processing (CS526) Spring 2012(Week 6).  A parallel algorithm is a group of partitioned tasks that work with each other to solve a large problem.
Ali Saoud Object Based Transactional Memory. Introduction Resent trends go towards object based SMT because it’s dynamic Word-based STM systems are more.
Transactional Memory (TM) Evan Jolley EE 6633 December 7, 2012.
TOWARDS A SOFTWARE TRANSACTIONAL MEMORY FOR GRAPHICS PROCESSORS Daniel Cederman, Philippas Tsigas and Muhammad Tayyab Chaudhry.
Transactional Memory Yujia Jin. Lock and Problems Lock is commonly used with shared data Priority Inversion –Lower priority process hold a lock needed.
1 MetaTM/TxLinux: Transactional Memory For An Operating System Hany E. Ramadan, Christopher J. Rossbach, Donald E. Porter and Owen S. Hofmann Presenter:
Obstruction-free synchronization Article by: Maurice Herlihy, Victor Luchangco, Mark Moir Double-Ended Queues as an example Presentation : Or Peri.
Algorithmics for Software Transactional Memory Hagit Attiya Technion.
CS510 Advanced OS Seminar Class 10 A Methodology for Implementing Highly Concurrent Data Objects by Maurice Herlihy.
Software Transactional Memory for Dynamic-sized Data Structures Maurice Herlihy, Victor Luchango, Mark Moir, William N. Scherer III Presented by: Irina.
Supporting Nested Transactional Memory in LogTM Authors Michelle J Moravan Mark Hill Jayaram Bobba Ben Liblit Kevin Moore Michael Swift Luke Yen David.
CS510 Concurrent Systems Class 2 A Lock-Free Multiprocessor OS Kernel.
CS510 Concurrent Systems Class 13 Software Transactional Memory Should Not be Obstruction-Free.
Language Support for Lightweight transactions Tim Harris & Keir Fraser Presented by Narayanan Sundaram 04/28/2008.
The Cost of Privatization Hagit Attiya Eshcar Hillel Technion & EPFLTechnion.
Software Transaction Memory for Dynamic-Sized Data Structures presented by: Mark Schall.
Why The Grass May Not Be Greener On The Other Side: A Comparison of Locking vs. Transactional Memory Written by: Paul E. McKenney Jonathan Walpole Maged.
An Introduction to Software Transactional Memory
CS510 Concurrent Systems Jonathan Walpole. A Lock-Free Multiprocessor OS Kernel.
Reduced Hardware NOrec: A Safe and Scalable Hybrid Transactional Memory Alexander Matveev Nir Shavit MIT.
Software Transactional Memory Yoav Cohen Seminar in Distributed Computing Spring 2007 Yoav Cohen Seminar in Distributed Computing Spring 2007.
A Qualitative Survey of Modern Software Transactional Memory Systems Virendra J. Marathe Michael L. Scott.
Transactional Memory Lecturer: Danny Hendler.  Speeding up uni-processors is harder and harder  Intel, Sun (RIP), AMD, IBM now focusing on “multi-core”
CS5204 – Operating Systems Transactional Memory Part 2: Software-Based Approaches.
Optimistic Design 1. Guarded Methods Do something based on the fact that one or more objects have particular states  Make a set of purchases assuming.
State Teleportation How Hardware Transactional Memory can Improve Legacy Data Structures Maurice Herlihy and Eli Wald Brown University.
1 Contention Management and Obstruction-free Algorithms Niloufar Shafiei.
On the Performance of Window-Based Contention Managers for Transactional Memory Gokarna Sharma and Costas Busch Louisiana State University.
Transactional Memory Lecturer: Danny Hendler. 2 2 From the New York Times…
Why STMs Need Compilers (a war story) Maurice Herlihy Brown University.
Non-Blocking Concurrent Data Objects With Abstract Concurrency By Jack Pribble Based on, “A Methodology for Implementing Highly Concurrent Data Objects,”
DOUBLE INSTANCE LOCKING A concurrency pattern with Lock-Free read operations Pedro Ramalhete Andreia Correia November 2013.
Optimistic Methods for Concurrency Control By: H.T. Kung and John Robinson Presented by: Frederick Ramirez.
Wait-Free Multi-Word Compare- And-Swap using Greedy Helping and Grabbing Håkan Sundell PDPTA 2009.
Practical concurrent algorithms Mihai Letia Concurrent Algorithms 2012 Distributed Programming Laboratory Slides by Aleksandar Dragojevic.
CS510 Concurrent Systems Jonathan Walpole. A Methodology for Implementing Highly Concurrent Data Objects.
Software Transactional Memory Should Not Be Obstruction-Free Robert Ennals Presented by Abdulai Sei.
CS510 Concurrent Systems Jonathan Walpole. RCU Usage in Linux.
© 2008 Multifacet ProjectUniversity of Wisconsin-Madison Pathological Interaction of Locks with Transactional Memory Haris Volos, Neelam Goyal, Michael.
A Methodology for Implementing Highly Concurrent Data Objects by Maurice Herlihy Slides by Vincent Rayappa.
Techniques and Structures in Concurrent Programming Wilfredo Velazquez.
November 27, 2007 Verification of a Concurrent Priority Queue Bart Verzijlenberg.
MULTIVIE W Slide 1 (of 21) Software Transactional Memory Should Not Be Obstruction Free Paper: Robert Ennals Presenter: Emerson Murphy-Hill.
CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: :30 AM.
Optimistic Design CDP 1. Guarded Methods Do something based on the fact that one or more objects have particular states Make a set of purchases assuming.
CS510 Concurrent Systems Tyler Fetters. A Methodology for Implementing Highly Concurrent Data Objects.
Maurice Herlihy, Victor Luchangco, Mark Moir, William N. Scherer III
Maurice Herlihy and J. Eliot B. Moss,  ISCA '93
Minh, Trautmann, Chung, McDonald, Bronson, Casper, Kozyrakis, Olukotun
Part 2: Software-Based Approaches
PHyTM: Persistent Hybrid Transactional Memory
Faster Data Structures in Transactional Memory using Three Paths
Challenges in Concurrent Computing
Maurice Herlihy, Victor Luchangco, Mark Moir, William N. Scherer III
A Qualitative Survey of Modern Software Transactional Memory Systems
Hybrid Transactional Memory
Software Transactional Memory Should Not be Obstruction-Free
Locking Protocols & Software Transactional Memory
Kernel Synchronization II
Lecturer: Danny Hendler
Lecture 1: Introduction
Presentation transcript:

Software Transactional Memory for Dynamic-Sized Data Structures Maurice Herlihy, Victor Luchangco, Mark Moir, William Scherer Presented by: Gokul Soundararajan

2 Outline Background Background Software Transactional Memory (STM) Software Transactional Memory (STM) –Implementation –Long Example Experimental Results Experimental Results Conclusion Conclusion

3 Transaction A sequence of operations on components of a data structure executed by a single thread Atomic Atomic: either – –Commits: takes effect – –Aborts: its effects are discarded Linearizable: preserves program order

4 Transactional Memory Any system that supports concurrent execution of transactions performed by threads Originally, a hardware idea Now, implemented in software

5 Transactional Objects container Is a container for a regular object A transaction accesses it – –Open – –Read/modify – –Changes are not seen until the transaction commits Creation and initialization of a transactional object is not a part of any transaction

6 DSTM Implementation container Is a container for a regular object TMObject class TMObject class –Implements a transactional object Class: TMObject Locator {Transaction, oldObject, newObject} Locator * start open( ) release( )

7 DSTM Implementation transaction oldObject newObject The transaction that most recently opened the object in WRITE mode A new object version An old object version start TMObject Locator

8 Current Version Current version of a transactional object Current version of a transactional object –Determined by the status of the transaction (T) that most recently opened the object in WRITE mode T Status Current Version Other Version COMMITTEDnewObjectmeaningless ABORTEDoldObjectmeaningless ACTIVEoldObjectTentativeVersion

9 Open(WRITE): T is COMMITTED transaction oldObject newObject T: COMMITTED newVersion oldVersion start myObj

10 Open(WRITE): T is COMMITTED transaction oldObject newObject T: COMMITTED newVersion oldVersion start transaction oldObject newObject A: ACTIVE A opens myObj in WRITE mode myObj

11 Open(WRITE): T is COMMITTED transaction oldObject newObject T: COMMITTED newVersion oldVersion start transaction oldObject newObject A: ACTIVE Copy of newVersion A opens myObj in WRITE mode myObj copy

12 Open(WRITE): T is COMMITTED transaction oldObject newObject T: COMMITTED newVersion oldVersion start transaction oldObject newObject A: ACTIVE Copy of newVersion A opens myObj in WRITE mode myObj copy

13 Open(WRITE): T is COMMITTED transaction oldObject newObject T: COMMITTED newVersion oldVersion start transaction oldObject newObject A: ACTIVE Copy of newVersion A opens myObj in WRITE mode myObj copy CAS

14 Open(WRITE): T is ABORTED transaction oldObject newObject T: ABORTED newVersion oldVersion start transaction oldObject newObject A: ACTIVE A opens myObj in WRITE mode myObj

15 Open(WRITE): T is ABORTED transaction oldObject newObject T: ABORTED newVersion oldVersion start transaction oldObject newObject A: ACTIVE Copy of oldVersion A opens myObj in WRITE mode myObj copy

16 Open(WRITE): T is ABORTED transaction oldObject newObject T: ABORTED newVersion oldVersion start transaction oldObject newObject A: ACTIVE Copy of oldVersion A opens myObj in WRITE mode myObj copy

17 Open(WRITE): T is ABORTED transaction oldObject newObject T: ABORTED newVersion oldVersion start transaction oldObject newObject A: ACTIVE Copy of oldVersion A opens myObj in WRITE mode myObj copy

18 Open(WRITE): T is ACTIVE transaction oldObject newObject T: ACTIVE newVersion oldVersion start transaction oldObject newObject A: ACTIVE A opens myObj in WRITE mode myObj A tries to abort T ?

19 Example: Integer Set Specifications: Specifications: –Object: Integer Set –Supports:  insert(v)  delete(v)  member(v) Implementation: Implementation: –Linked list of a set of elements –Sorted in ascending order

20 Integer Set Example: Constructor MIN next MAX next start

21 Integer Set Example: insert(40) MIN next MAX next -20 next 30 next first thread 40 next newElm T ACTIVE start T COMMITED start newNode

22 Integer Set Example: insert(40) MIN next MAX next -20 next 30 next MIN next first thread 40 next newElm T ACTIVE start T N O T COMMITED start newNode

23 Integer Set Example: insert(40) MIN next MAX next -20 next 30 next MIN next first thread -20 next 40 next newElm T ACTIVE start T N O T N O T COMMITED start newNode

24 Integer Set Example: insert(40) MIN next MAX next -20 next 30 next MIN next first thread -20 next 40 next newElm 30 next T ACTIVE start T N O T N O T N O T COMMITED start newNode

25 Integer Set Example: insert(40) MIN next MAX next -20 next 30 next MIN next first thread -20 next 40 next newElm 30 next T ACTIVE start T N O T N O T N O T COMMITED start newNode

26 Integer Set Example: insert(40) MIN next MAX next -20 next 30 next MIN next first thread -20 next 40 next newElm 30 next MAX next T ACTIVE start T N O T N O T N O T N O T COMMITED start newNode

27 Integer Set Example: insert(40) MIN next MAX next -20 next 30 next MIN next first thread -20 next 40 next newElm 30 next MAX next T ACTIVE start T N O T N O T N O T N O T COMMITED start newNode

28 DSTM and Sequential Code Differences: –Need to catch Denied exception –Retry transaction that fails to commit –Distinguish between transactional objects and non-transactional objects

29 Obstruction Freedom Guarantees progress for any thread that eventually executes without interference for a sufficient number of steps Guarantees progress for any thread that eventually executes without interference for a sufficient number of steps Strong enough to avoid problems associated with locks Strong enough to avoid problems associated with locks Ensures that no thread can be blocked by delays or failures of other threads Ensures that no thread can be blocked by delays or failures of other threads Live-lock Live-lock –Livelock Freedom - If some process wants to enter the critical section, then some process will eventually enter the critical section.

30 Obstruction Freedom Weaker progress guarantee than wait-freedom Weaker progress guarantee than wait-freedom –All processes are guaranteed to complete the access in finite time, regardless of the actions of the other processes. BUT: BUT: Efficient Contention Manager + Obstruction Freedom Wait Freedom In Practice

31 Contention Management Methods: Methods: –Aggressive  Abort the conflicting transaction  Interrupting a partially executed operation will not jeopardise correctness –Polite  Operations “back off” when they encounter interference  Wait for some time before retrying

32 Contention Management Contention manager is invoked only in case of contention Contention manager is invoked only in case of contention In most lock-free and wait-free implementations, mechanisms used to ensure progress impose significant overhead even in the absence of contention In most lock-free and wait-free implementations, mechanisms used to ensure progress impose significant overhead even in the absence of contention

33 Experiments Benchmarks Benchmarks –IntSet –IntSet with Early Release –RBTree Contention Management Contention Management –Aggressive – abort the conflicting transaction –Polite – have a back-off algorithm

34 Results

35 Results

36 Results

37 Results

38 Conclusion Presented Presented –Transactional Memory in Java/C++ –Probably easier in Java (because of the Object data type) –Good performance over simple locking