Transactions are back But are they the same? R. Guerraoui, EPFL.

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.
Raphael Eidenbenz Roger Wattenhofer Roger Wattenhofer Good Programming in Transactional Memory Game Theory Meets Multicore Architecture.
Database Systems (資料庫系統)
1 Concurrency Control Chapter Conflict Serializable Schedules  Two actions are in conflict if  they operate on the same DB item,  they belong.
Impossibilities for Disjoint-Access Parallel Transactional Memory : Alessia Milani [Guerraoui & Kapalka, SPAA 08] [Attiya, Hillel & Milani, SPAA 09]
TRANSACTION PROCESSING SYSTEM ROHIT KHOKHER. TRANSACTION RECOVERY TRANSACTION RECOVERY TRANSACTION STATES SERIALIZABILITY CONFLICT SERIALIZABILITY VIEW.
Principles of Transaction Management. Outline Transaction concepts & protocols Performance impact of concurrency control Performance tuning.
Sathya Peri IIT Patna 1 Understanding the Requirements of STMs.
CS492B Analysis of Concurrent Programs Lock Basics Jaehyuk Huh Computer Science, KAIST.
1 CS 194: Elections, Exclusion and Transactions Scott Shenker and Ion Stoica Computer Science Division Department of Electrical Engineering and Computer.
Transactional Locking Nir Shavit Tel Aviv University (Joint work with Dave Dice and Ori Shalev)
Safety Definitions and Inherent Bounds of Transactional Memory Eshcar Hillel.
Transactional Contention Management as a Non-Clairvoyant Scheduling Problem Alessia Milani [Attiya et al. PODC 06] [Attiya and Milani OPODIS 09]
Transactional Memory Overview Olatunji Ruwase Fall 2007 Oct
A Mile-High View of Concurrent Algorithms Hagit Attiya Technion.
TOWARDS A SOFTWARE TRANSACTIONAL MEMORY FOR GRAPHICS PROCESSORS Daniel Cederman, Philippas Tsigas and Muhammad Tayyab Chaudhry.
Concurrency Control and Recovery In real life: users access the database concurrently, and systems crash. Concurrent access to the database also improves.
1 Johannes Schneider Transactional Memory: How to Perform Load Adaption in a Simple And Distributed Manner Johannes Schneider David Hasenfratz Roger Wattenhofer.
Distributed Systems 2006 Styles of Client/Server Computing.
Formalisms and Verification for Transactional Memories Vasu Singh EPFL Switzerland.
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.
1 Transaction Management Overview Yanlei Diao UMass Amherst March 15, 2007 Slides Courtesy of R. Ramakrishnan and J. Gehrke.
Session - 14 CONCURRENCY CONTROL CONCURRENCY TECHNIQUES Matakuliah: M0184 / Pengolahan Data Distribusi Tahun: 2005 Versi:
Selfishness in Transactional Memory Raphael Eidenbenz, Roger Wattenhofer Distributed Computing Group Game Theory meets Multicore Architecture.
Transaction Management
Concurrency and Software Transactional Memories Satnam Singh, Microsoft Faculty Summit 2005.
CS533 - Concepts of Operating Systems
Database Management Systems I Alex Coman, Winter 2006
Transactions Amol Deshpande CMSC424. Today Project stuff… Summer Internships 
Transactions and Recovery
TRANSACTIONS AND CONCURRENCY CONTROL Sadhna Kumari.
An Introduction to Software Transactional Memory
Window-Based Greedy Contention Management for Transactional Memory Gokarna Sharma (LSU) Brett Estrade (Univ. of Houston) Costas Busch (LSU) 1DISC 2010.
How Good can a Transactional Memory be? R. Guerraoui, EPFL.
Distributed Transactions
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.
TRANSACTION MANAGEMENT R.SARAVANAKUAMR. S.NAVEEN..
A Consistency Framework for Iteration Operations in Concurrent Data Structures Yiannis Nikolakopoulos A. Gidenstam M. Papatriantafilou P. Tsigas Distributed.
Transactions and Concurrency Control Distribuerade Informationssystem, 1DT060, HT 2013 Adapted from, Copyright, Frederik Hermans.
Introduction to Database Systems1. 2 Basic Definitions Mini-world Some part of the real world about which data is stored in a database. Data Known facts.
Concurrency Control. Objectives Management of Databases Concurrency Control Database Recovery Database Security Database Administration.
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…
Transactional Memory R. Guerraoui, EPFL. Locking is ’’history’’ Lock-freedom is difficult.
A Methodology for Creating Fast Wait-Free Data Structures Alex Koganand Erez Petrank Computer Science Technion, Israel.
Wait-Free Multi-Word Compare- And-Swap using Greedy Helping and Grabbing Håkan Sundell PDPTA 2009.
Transactional Locking Nir Shavit Tel Aviv University Joint work with Dave Dice and Ori Shalev.
Introduction.  Administration  Simple DBMS  CMPT 454 Topics John Edgar2.
Software Transactional Memory Should Not Be Obstruction-Free Robert Ennals Presented by Abdulai Sei.
A Methodology for Implementing Highly Concurrent Data Objects by Maurice Herlihy Slides by Vincent Rayappa.
Alpine Verification Meeting 2008 Model Checking Transactional Memories Vasu Singh (Joint work with Rachid Guerraoui, Tom Henzinger, Barbara Jobstmann)
MULTIVIE W Slide 1 (of 21) Software Transactional Memory Should Not Be Obstruction Free Paper: Robert Ennals Presenter: Emerson Murphy-Hill.
Lecture 9- Concurrency Control (continued) Advanced Databases Masood Niazi Torshiz Islamic Azad University- Mashhad Branch
ECE 1747: Parallel Programming Short Introduction to Transactions and Transactional Memory (a.k.a. Speculative Synchronization)
Lecture 5 Page 1 CS 111 Summer 2013 Bounded Buffers A higher level abstraction than shared domains or simple messages But not quite as high level as RPC.
Novel Paradigms of Parallel Programming Prof. Smruti R. Sarangi IIT Delhi.
Transactional Contention Management as a Non-Clairvoyant Scheduling Problem Hagit Attiya, Alessia Milani Technion, Haifa-LABRI, University of Bordeaux.
Lecture 20: Consistency Models, TM
PHyTM: Persistent Hybrid Transactional Memory
Multicore Programming Final Review
Faster Data Structures in Transactional Memory using Three Paths
Challenges in Concurrent Computing
Transactions are back But are they the same? R. Guerraoui , EPFL
Lecture 22: Consistency Models, TM
Distributed Transactions
Transaction Management
Deferred Runtime Pipelining for contentious multicore transactions
Lecture 23: Transactional Memory
Presentation transcript:

Transactions are back But are they the same? R. Guerraoui, EPFL

- Le retour de Martin Guerre - (Sommersby)

From the New York Times San Francisco, May 7, 2004 Intel announces a drastic change in its business strategy: « Multicore is THE way to boost performance »

The free ride is over Every one will need to fork threads

Forking threads is easy Handling the conflicts is hard

Coarse grained locks => slow Fine grained locks => errors (Most Java bugs are due to misuse of he word « synchronized »)

Double-ended queue Enqueue Dequeue

Lock-free computing? Every lock-free data structure  # podc/disc/spaa papers

A concurrency control abstraction that is: Simple to use Efficient to implement

Transactions Cope with both concurrency and recovery control

accessing object 1; accessing object 2; Back to the undergraduate level Begin { end }

Transactions Consistency Contract (ACID) C A-I-D

Historical perspective Eswaran et al (CACM’76) Database Papadimitriou (JACM’79) Theory Liskov/Sheifler (TOPLAS’82) Language Knight (ICFP’86) Architecture Herlihy/Moss (ISCA’93) Hardware Shavit/Touitou (PODC’95) Software

Simple example (consistency invariant) 0 < x < y

T: x := x+1 ; y:= y+1 Simple example (transaction)

You: « atomicity » (AID) Grand’ma: « consistency » ( C) Consistency Contract C A-I-D

A history is atomic if its restriction to committed transactions is serializable The underlying theory (P’79)

A history H of committed transactions is serializable if there is a history S(H) that is (1) equivalent to H (2) sequential (3) legal

This is all fine But this is not new Why should we care? Because we want jobs

Transactions are indeed back But are they really the same? How can we figure that out?

Ask system people System people know « Those who know don’t need to think » Iggy Pop

Simple algorithm (DSTM) To write an object O, a transaction acquires O and aborts “the” transaction that owns O To read an object, a transaction T takes a snapshot to see if the system hasn’t changed since T’s last reads; else T is aborted

Simple algorithm (DSTM) Killer write (ownership) Careful read (validation)

More efficient algorithm Apologizing versus asking permission Killer write Optimistic read: validity check at commit time

Am I smarter than a system guy? No way

Back to the example Invariant: 0 < x < y Initially: x := 1; y := 2

Division by zero T1: x := x+1 ; y:= y+1 T2: z := 1 / (y - x)

T1: x := 3; y:= 6 Infinite loop T2: a := y; b:= x; repeat b:= b + 1 until a = b

System people care about live transactions Theoreticians didn’t

We need a theory that talks about ALL transactions The old theory A history is atomic if its restriction to committed transactions is serializable

A history H is opaque if for every transaction T in H, there is a serializable history in committed(T,H) A new theory: Opacity (KG’06)

A new theory is nice but is it useful? Check with system people

Simple algorithm (DSTM) Careful read (validation) Killer write (ownership)

Visible vs Invisible Read (SXM; RSTM) Write is mega killer: to write an object, a transaction aborts any live one which has read or written the object Visible but not so careful read: when a transaction reads an object, it says so

Conjecture Either the read has to be visible or has to be careful Wrong

Giving up Progress (TL2) To write an object, a transaction acquires it and writes its timestamp To read an object, the transaction aborts itself if the object was written by a transaction with a higher timestamp

Theorem (GK’06) Visible read Vs Validation Vs (solo) Progress

The theorem does not hold for classical atomicity i.e., the theorem does not hold for database transactions

Solo progress cannot be ensured with disjoint access parallelism Solo progress cannot be ensured with transparent reads More theorems (GK’07)

Many more issues Progress? Real-time? Performance? Hardware support? Linguistic support?

With solo progress, some transactions might never commit Can we ensure that all transactions eventually commit? Progress

Theorem (GKK06): Solo progress and eventual global progress are incompatible When exactly can we ensure eventual global progress (resp. solo progress)?

If a transaction T wants to write an object O owned by another transaction, it calls a contention manager Various contention management strategies are possible Progress/Real-Time

System Perspective Scherer and Scott [CSJP 04] Exponential backoff “Karma” Transaction with most work accomplished wins Various priority inheritance schemes … Some work well, but … Can’t prove anything!

Greedy Contention Manager (GHP’05) State Priority (based on start time) Waiting flag (set while waiting) Wait if other has Higher priority AND not waiting Abort other if lower priority OR waiting

Preliminary Result Compare time to complete transaction schedule for Ideal off-line scheduler Knows transactions, conflicts, and start times in advance Greedy contention manager Does not know anything …

Competitive Ratio Let s be the number of objects accessed by all transactions Compare time to commit all transactions Greedy is O(s)-competitive with the off-line adversary GHP’05 O(s 2 ) AEST’06 O(s)

Many more issues Progress? Real-time? Performance? Hardware support? Linguistic support?

Performance How to evaluate transactional memory implementations? So far, mainly micro-benchmarks (linked lists, red-black trees)

Benchmarks STMBench7 (GKV’06) Dividing STMs by zero

memory/biblio/index.html Sun, Intel, IBM, EU (VELOX) ISCA, OOPSLA, PODC, DISC, POPL, PPoPP, Transact What about SRDS? The Topic is VERY HOT

Transactions are conquering the parallel programming world They look simple and familiar and thus make the programmer happy Their implementation is in fact very tricky and that should make YOU happy The one slide to remember

Real-time T1: y := x; commit T2: x := x+1; commit T3: y := y+1; commit

Real-time X Y commit T1 (read(x)) T1 (write(y)) T2 (read-write(x)) commit T2 (read-write(y))

Recoverability is not enough commit T1 (read(x)) T1 (write(y)) T2 (read-write(x)) commit T2 (read-write(y))

User 1User 2 Transaction Server Classical database transactions Database (disk)

User 1User 2 Transaction server + database In-memory transactions Fast processor

Thread 4Thread 3 Thread 2 Processor 3Processor 2Processor 1 Transactional language: shared memory Thread 1 Shared memory transactions