Software Transaction Memory for Dynamic-Sized Data Structures presented by: Mark Schall.

Slides:



Advertisements
Similar presentations
CM20145 Concurrency Control
Advertisements

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.
Transaction Management: Concurrency Control CS634 Class 17, Apr 7, 2014 Slides based on “Database Management Systems” 3 rd ed, Ramakrishnan and Gehrke.
Synchronization. How to synchronize processes? – Need to protect access to shared data to avoid problems like race conditions – Typical example: Updating.
Concurrency: Deadlock and Starvation Chapter 6. Deadlock Permanent blocking of a set of processes that either compete for system resources or communicate.
Concurrency: Mutual Exclusion and Synchronization Chapter 5.
Principles of Transaction Management. Outline Transaction concepts & protocols Performance impact of concurrency control Performance tuning.
Concurrency Control Amol Deshpande CMSC424. Approach, Assumptions etc.. Approach  Guarantee conflict-serializability by allowing certain types of concurrency.
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 –
Ali Saoud Object Based Transactional Memory. Introduction Resent trends go towards object based SMT because it’s dynamic Word-based STM systems are more.
Java How to Program, 9/e CET 3640 Professor: Dr. José M. Reyes Álamo © Copyright by Pearson Education, Inc. All Rights Reserved.
PARALLEL PROGRAMMING with TRANSACTIONAL MEMORY Pratibha Kona.
©Silberschatz, Korth and Sudarshan16.1Database System Concepts 3 rd Edition Chapter 16: Concurrency Control Lock-Based Protocols Timestamp-Based Protocols.
Concurrent Processes Lecture 5. Introduction Modern operating systems can handle more than one process at a time System scheduler manages processes and.
Concurrency CS 510: Programming Languages David Walker.
Software Transactional Memory for Dynamic-sized Data Structures Maurice Herlihy, Victor Luchango, Mark Moir, William N. Scherer III Presented by: Irina.
Concurrency: Mutual Exclusion, Synchronization, Deadlock, and Starvation in Representative Operating Systems.
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.
©Silberschatz, Korth and Sudarshan16.1Database System Concepts 3 rd Edition Chapter 16: Concurrency Control Lock-Based Protocols Timestamp-Based Protocols.
18.8 Concurrency Control by Timestamps - Dongyi Jia - CS257 ID:116 - Spring 2008.
Concurrency Control Chapter 18 Section 18.5 Presented by Khadke, Suvarna CS 257 (Section II) Id
Concurrency Control In Dynamic Database Systems Laurel Jones.
An Introduction to Software Transactional Memory
Software Transactional Memory for Dynamic-Sized Data Structures Maurice Herlihy, Victor Luchangco, Mark Moir, William Scherer Presented by: Gokul Soundararajan.
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.
Distributed Transactions
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.
Use of Coverity & Valgrind in Geant4 Gabriele Cosmo.
November 15, 2007 A Java Implementation of a Lock- Free Concurrent Priority Queue Bart Verzijlenberg.
Chapter 11 Concurrency Control. Lock-Based Protocols  A lock is a mechanism to control concurrent access to a data item  Data items can be locked in.
Chapter 15 Concurrency Control Yonsei University 1 st Semester, 2015 Sanghyun Park.
Concurrency Control Concurrency Control By Dr.S.Sridhar, Ph.D.(JNUD), RACI(Paris, NICE), RMR(USA), RZFM(Germany) DIRECTOR ARUNAI ENGINEERING COLLEGE TIRUVANNAMALAI.
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.
Optimistic Methods for Concurrency Control By: H.T. Kung and John Robinson Presented by: Frederick Ramirez.
Page 1 Concurrency Control Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation.
CS510 Concurrent Systems Jonathan Walpole. A Methodology for Implementing Highly Concurrent Data Objects.
Monitors and Blocking Synchronization Dalia Cohn Alperovich Based on “The Art of Multiprocessor Programming” by Herlihy & Shavit, chapter 8.
Software Transactional Memory Should Not Be Obstruction-Free Robert Ennals Presented by Abdulai Sei.
Concurrency Control Introduction Lock-Based Protocols
1 Concurrency control lock-base protocols timestamp-based protocols validation-based protocols Ioan Despi.
© 2008 Multifacet ProjectUniversity of Wisconsin-Madison Pathological Interaction of Locks with Transactional Memory Haris Volos, Neelam Goyal, Michael.
Design Principles and Common Security Related Programming Problems
Quick Test Professional 9.2. Testing Process Preparing to Record Recording Enhancing a Test Debugging Running the Test and Analyzing the Results Reporting.
MULTIVIE W Slide 1 (of 21) Software Transactional Memory Should Not Be Obstruction Free Paper: Robert Ennals Presenter: Emerson Murphy-Hill.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
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.
Mutual Exclusion Algorithms. Topics r Defining mutual exclusion r A centralized approach r A distributed approach r An approach assuming an organization.
Maurice Herlihy, Victor Luchangco, Mark Moir, William N. Scherer III
Part 2: Software-Based Approaches
Concurrency Control Techniques
Transaction Management and Concurrency Control
Functions of a Database Management System
Faster Data Structures in Transactional Memory using Three Paths
Concurrency Control.
Challenges in Concurrent Computing
18.5 An Architecture for a Locking Scheduler
Maurice Herlihy, Victor Luchangco, Mark Moir, William N. Scherer III
A Qualitative Survey of Modern Software Transactional Memory Systems
Chapter 15 : Concurrency Control
Hybrid Transactional Memory
Introduction of Week 13 Return assignment 11-1 and 3-1-5
Concurrency: Mutual Exclusion and Process Synchronization
Software Transactional Memory Should Not be Obstruction-Free
Lecturer: Danny Hendler
Synchronization and liveness
Presentation transcript:

Software Transaction Memory for Dynamic-Sized Data Structures presented by: Mark Schall

The Problem Using locks introduces well-known problems Coarse-grained locks: May block threads when not necessary Fine-grained locks: Complex/Error-prone

Dynamic Software Transactional Memory Synchronize shared data without using locks Transaction and transaction objects can be created dynamically Well suited to implement dynamic-sized data structures: Lists and Trees

Transactions A sequence of instructions from a single thread Either commits or aborts Appears to take effect one after another

Transaction Object: TMObject Accessed by transactions Container for a regular Java object Transactions can open and read or write to the object

TMObject contd. Objects encapsulated must implement TMCloneable interface Requires the object to implement a clone() function DSTM guarantees during cloning the object will not change

TMObject::open() Transactions access the encapsulated object by calling the open() method The thread passes the mode in which to open the object with: WRITE or READ open() throws a Denied exception if the object attempted to open was opened by another thread in a conflicting mode.

IntSet Example

Obstruction-Freedom Simplifies the implementation Ensures that halted threads cannot prevent other threads from making progress Does not rule out livelock: Concurrent threads may repeatedly prevent one another from making progress Transactions are able to abort other transactions Allows for prioritizing transactions

IntSet Example contd. Opening objects not necessary to write in read-only mode may reduce conflicts Releasing the object will relieve any conflicts other transactions may have with that object Note: Only can release READ objects

Implementation: Opening TMObjects Each transactional object has three fields: Transaction: points to the transaction that created the object oldObject: points to the original version of the object newObject: points to the copy/modified version of the object

Conflicting TMObjects::open() If transaction A tries to open an object already opened by another transaction B A can abort B or A can wait for B to be aborted or commited This is determined by the contention manager

Read-only TMObjects::open() Conflicts with open will be resolved using the contention manager When opened, the object and the last committed version are stored in a local read-only table Every read-only open in a transaction will increment a counter in the table to match open(READ) and release() calls

Validating DSTM must validate an open to ensure the state of the transaction Validation requires two steps: 1) For each pair of TMObject and encapsulated object in the read only table, verify that the object is still the most recent committed object for the transactional object. 2) Check that the Transaction is still active

Committing Committing requires validating the entries and changing the status of the transaction to COMMITTED

Contention Manager Each thread/transaction has a contention manager Determines whether a transaction should either: abort another transaction immediately allow the other transaction a chance to complete Explicit measures are often necessary to avoid starvation Its responsibility is progress Contention managers may consult with each other

Contention Manager Interface Notification methods: informs the manager of relevant events Success/Failure of commits Attempts to open objects Feedback methods: determine the actions that should be taken in circumstances Aborting another transaction

Contention Manager Correctness (Informally): "Any active transaction that asks sufficiently many times must eventually get permission to abort a conflicting transaction" Preserves obstruction freedom Correctness does not guarantee progress

Contention Manager contd. Application, environment, and other factors decide policy Modular implementation allows fine tuning of desired: progress guarantees transaction prioritization

Content Management Examples Aggressive: Always and immediately grants permission to abort other transactions Polite: Adaptively backs off a few times when encountering conflicts Sleeps for a random amount of time Any other attempts will double the amount of time At some threshold the manager will allow an abort

Experiments Measure the number of operations completed (committed) over a period of 20 seconds Number of threads varied from 1 and 576 threads Each operation chose randomly to delete or insert a value from 0 to 255

Results

Conclusions Contention management schemes are required to avoid livelock Implementation still requires forethought from programmers