Reduction Theorems for Proving Serializability with Application to RCU-Based Synchronization Hagit Attiya Technion Work with Ramalingam and Rinetzky (POPL.

Slides:



Advertisements
Similar presentations
Inherent limitations facilitate design and verification of concurrent programs Hagit Attiya Technion.
Advertisements

Guy Golan-GuetaTel-Aviv University Nathan Bronson Stanford University Alex Aiken Stanford University G. Ramalingam Microsoft Research Mooly Sagiv Tel-Aviv.
Optimistic Methods for Concurrency Control By : H.T. Kung & John T. Robinson Presenters: Munawer Saeed.
Unit 9 Concurrency Control. 9-2 Wei-Pang Yang, Information Management, NDHU Content  9.1 Introduction  9.2 Locking Technique  9.3 Optimistic Concurrency.
1 Lecture 11: Transactions: Concurrency. 2 Overview Transactions Concurrency Control Locking Transactions in SQL.
Impossibilities for Disjoint-Access Parallel Transactional Memory : Alessia Milani [Guerraoui & Kapalka, SPAA 08] [Attiya, Hillel & Milani, SPAA 09]
The complexity of predicting atomicity violations Azadeh Farzan Univ of Toronto P. Madhusudan Univ of Illinois at Urbana Champaign.
Principles of Transaction Management. Outline Transaction concepts & protocols Performance impact of concurrency control Performance tuning.
Concurrency Control II
Reduction, abstraction, and atomicity: How much can we prove about concurrent programs using them? Serdar Tasiran Koç University Istanbul, Turkey Tayfun.
Concurrency Control Part 2 R&G - Chapter 17 The sequel was far better than the original! -- Nobody.
Safety Definitions and Inherent Bounds of Transactional Memory Eshcar Hillel.
Inherent limitations on DAP TMs 1 Inherent Limitations on Disjoint-Access Parallel Transactional Memory Hagit Attiya, Eshcar Hillel, Alessia Milani Technion.
A Programming Language View of Transactional Memory Hagit Attiya, Technion Joint work with Sandeep Hans, Alexey Gotsman and Noam Rinetzky Published in.
Inherent limitations facilitate design & verification of concurrent programs Hagit Attiya Technion.
Atomicity in Multi-Threaded Programs Prachi Tiwari University of California, Santa Cruz CMPS 203 Programming Languages, Fall 2004.
Quick Review of Apr 29 material
Sequential reductions for verifying serializability Hagit Attiya Technion & EPFL G. RamalingamMSR India Noam Rinetzky University of London.
A Mile-High View of Concurrent Algorithms Hagit Attiya Technion.
Sequential reductions for verifying serializability Hagit Attiya Technion & EPFL G. RamalingamMSR India Noam Rinetzky University of London.
Concurrent Transactions Even when there is no “failure,” several transactions can interact to turn a consistent state into an inconsistent state.
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
CS 582 / CMPE 481 Distributed Systems Concurrency Control.
Principle 1 If more than one thread accesses a given state variable and one of them might write to it then All accesses to the variable must be correctly.
Algorithmics for Software Transactional Memory Hagit Attiya Technion.
Transaction Management and Concurrency Control
Chapter 11 Grid Concurrency Control 11.1 A Grid Database Environment 11.2 An Example 11.3 Grid Concurrency Control (GCC) 11.4 Correctness of GCC 11.5 Features.
Session - 14 CONCURRENCY CONTROL CONCURRENCY TECHNIQUES Matakuliah: M0184 / Pengolahan Data Distribusi Tahun: 2005 Versi:
Session - 13 CONCURRENCY CONTROL CONCURRENCY TECHNIQUE Matakuliah: M0184 / Pengolahan Data Distribusi Tahun: 2005 Versi:
Transaction Processing: Concurrency and Serializability 10/4/05.
Transaction Management
Transactions or Concurrency Control. Introduction A program which operates on a DB performs 2 kinds of operations: –Access to the Database (Read/Write)
Transactions. Definitions Transaction (program): A series of Read/Write operations on items in a Database. Example: Transaction 1 Read(C) Read(A) Write(A)
Concurrency. Correctness Principle A transaction is atomic -- all or none property. If it executes partly, an invalid state is likely to result. A transaction,
The Cost of Privatization Hagit Attiya Eshcar Hillel Technion & EPFLTechnion.
/ PSWLAB Eraser: A Dynamic Data Race Detector for Multithreaded Programs By Stefan Savage et al 5 th Mar 2008 presented by Hong,Shin Eraser:
Academic Year 2014 Spring Academic Year 2014 Spring.
TRANSACTIONS AND CONCURRENCY CONTROL Sadhna Kumari.
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.
08_Transactions_LECTURE2 DBMSs should guarantee ACID properties (Atomicity, Consistency, Isolation, Durability). This is typically done by guaranteeing.
Solution to Dining Philosophers. Each philosopher I invokes the operations pickup() and putdown() in the following sequence: dp.pickup(i) EAT dp.putdown(i)
Cosc 4740 Chapter 6, Part 3 Process Synchronization.
Reduced Hardware NOrec: A Safe and Scalable Hybrid Transactional Memory Alexander Matveev Nir Shavit MIT.
On Reducing the Global State Graph for Verification of Distributed Computations Vijay K. Garg, Arindam Chakraborty Parallel and Distributed Systems Laboratory.
1 Concurrency Control II: Locking and Isolation Levels.
Concurrent Linked Lists and Linearizability Proofs Companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit Modified.
Optimistic Methods for Concurrency Control By: H.T. Kung and John Robinson Presented by: Frederick Ramirez.
Transactions and Concurrency Control. Concurrent Accesses to an Object Multiple threads Atomic operations Thread communication Fairness.
Wait-Free Multi-Word Compare- And-Swap using Greedy Helping and Grabbing Håkan Sundell PDPTA 2009.
A Simple Optimistic skip-list Algorithm Maurice Herlihy Brown University & Sun Microsystems Laboratories Yossi Lev Brown University & Sun Microsystems.
Software Transactional Memory Should Not Be Obstruction-Free Robert Ennals Presented by Abdulai Sei.
1 Concurrency control lock-base protocols timestamp-based protocols validation-based protocols Ioan Despi.
Transaction Management Transparencies. ©Pearson Education 2009 Chapter 14 - Objectives Function and importance of transactions. Properties of transactions.
Multidatabase Transaction Management COP5711. Multidatabase Transaction Management Outline Review - Transaction Processing Multidatabase Transaction Management.
Switch off your Mobiles Phones or Change Profile to Silent Mode.
Read-Log-Update A Lightweight Synchronization Mechanism for Concurrent Programming Alexander Matveev (MIT) Nir Shavit (MIT and TAU) Pascal Felber (UNINE)
Jinze Liu. ACID Atomicity: TX’s are either completely done or not done at all Consistency: TX’s should leave the database in a consistent state Isolation:
Distributed Transactions What is a transaction? (A sequence of server operations that must be carried out atomically ) ACID properties - what are these.
Chapter 13 Managing Transactions and Concurrency Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
6/18/2016Transactional Information Systems3-1 Part II: Concurrency Control 3 Concurrency Control: Notions of Correctness for the Page Model 4 Concurrency.
1 Concurrency Control. 2 Why Have Concurrent Processes? v Better transaction throughput, response time v Done via better utilization of resources: –While.
Outline Introduction Background Distributed DBMS Architecture
Concurrency Control II (OCC, MVCC)
Chapter 10 Transaction Management and Concurrency Control
Thread Synchronization
Does Hardware Transactional Memory Change Everything?
Distributed Transactions
Transaction management
Outline Introduction Background Distributed DBMS Architecture
Presentation transcript:

Reduction Theorems for Proving Serializability with Application to RCU-Based Synchronization Hagit Attiya Technion Work with Ramalingam and Rinetzky (POPL 2010) and work in progress with Maya Arbel

Sequential Reductions Design and verify concurrent data structures E.g., linked list with hand-over-hand locking [Kedem & Sliberschatz ‘76] [Smadi ‘76] [Bayer & Scholnick ‘77] t1t1 H t1t1 t1t1 t2t2 Dagstuhl, Feberuary 2013

Sequential Reductions Design and verify concurrent data structures E.g., linked list with hand-over-hand locking [Kedem & Sliberschatz ‘76] [Smadi ‘76] [Bayer & Scholnick ‘77] Consider only sequential executions, but conclude that properties hold in all executions t1t1 t2t2 t2t2 H t1t1 Dagstuhl, Feberuary 2013

Serializability operation interleaved execution complete non-interleaved execution ~ ~ ~ ~ ~ ~ ~ ~ ~ [Papadimitriou ‘79] Locally observed by threads Dagstuhl, Feberuary 2013

Serializability Yields Sequential Reduction Concurrent code M A small subset of all executions How to check M is serializable, w/o considering all executions? If M is serializable, then a local property φ holds in all executions of M iff φ holds in all complete non-interleaved executions Easily derived from [Papadimitriou ‘79] Dagstuhl, Feberuary 2013

Disciplined Programming with Locks Locking protocol ensures conflict serializability –two-phase locking (2PL), tree locking (TL), (dynamic) DAG locking Verify that M follows a local locking protocols –Depending only on thread’s local variables & global variables locked by it –Not a centralized concurrency control monitor! Local property of an execution holds in every execution indistinguishable from it Dagstuhl, Feberuary 2013

Reduction Theorem: Easy Step complete non-interleaved executions of M A local conflict serializable locking policy is respected in all executions iff it is respected in all non-interleaved executions A local property holds in all executions iff it holds in all non-interleaved executions Dagstuhl, Feberuary 2013

Reduction to non-interleaved executions: Proof idea σ is the shortest execution that does not follow LP  σ’ follows LP, guarantees conflict-serializability σ (t,e) σ’ Dagstuhl, Feberuary 2013

Reduction to non-interleaved executions: Proof idea σ is the shortest execution that does not follow LP  σ’ follows LP, guarantees conflict-serializability   non-interleaved execution σ’ ni “indistinguishable” from σ’ σ (t,e) σ’ σ’ ni Dagstuhl, Feberuary 2013

Reduction to non-interleaved executions: Proof idea σ is the shortest execution that does not follow LP  σ’ follows LP, guarantees conflict-serializability   non-interleaved execution σ’ ni “indistinguishable” from σ’   non-interleaved execution “indistinguishable” from σ’ where LP is violated σ (t,e) σ’ σ ni (t,e) Dagstuhl, Feberuary 2013

Further Reduction Almost-complete non-interleaved executions Need to argue about termination A local conflict serializable locking policy is respected in all executions iff it is respected in all almost-complete non-interleaved executions Dagstuhl, Feberuary 2013

Acni-reduction: Proof ideas Start from a ni-execution (use previous reduction) Create its equivalent completion, if possible Not always possible, e.g., Does not access variables accessed by later threads t 1 :lock(v),t 1 :lock(u),t 2 :lock(u) u v Dagstuhl, Feberuary 2013

Allows read-only operations (transactions) to read data, even when locked for updates Update operations (transactions) synchronize with each other using locks, and with read-only operations using synchronize_rcu Read-Copy-Update (RCU) RCU usage in the Linux kernel (from Paul McKenney) Dagstuhl, Feberuary 2013

RCU-Based Synchronization Not well-understood, especially when there are concurrent update operations  RCU-based scan of a list concurrently with two updates yields an inconsistent view –Consistency of two reads  contains on a sorted list has one critical read Dagstuhl, Feberuary 2013

Wait-Free “Contains” [Heller, Herlihy, Luchangco, Moir, Scherer, Shavit, OPODIS 2005] Wait-free search operation reads the list unprotected (regardless of locks)… Lazy write operations start locking only after finding the relevant item t1t1 H t1t1 Dagstuhl, Feberuary 2013

Principled RCU-Based Synchronization RCU-based linked list similar to pessimistic / optimistic / lazy list, which has been verified [Vafeiadis, Herlihy, Hoare, Shapiro, PPoPP 2006] But proof is not simple & what about other data structures, like search trees? Dagstuhl, Feberuary 2013

Our Approach Apply sequential reduction to the sub-execution with only update operations –Read-only transactions do not modify the data –Pessimistic list follows dynamic tree locking Prove structural properties / sortedness in almost- complete non-interleaved executions (easy) Dagstuhl, Feberuary 2013

Our Approach Then superimpose individual steps of the read- only operations onto the almost-complete non- interleaved executions Complete the proof by focusing on the single critical read Dagstuhl, Feberuary 2013

What’s Now? Concurrent updates in search trees  RCU-based balanced search trees, but they Pessimistically disallow concurrent updates, using a big lock (Bonsai) [Clements, Kaashoek, Zeldovich, ASPLOS 2012] Optimistically avoid concurrent updates, using TM (Red/black trees) [Howard, Walpole 2011?] Dagstuhl, Feberuary 2013

What’s Now? Handle optimistic / lazy hand-over-hand locking, by extending the reduction to –Shared (read) locks –Initial failure and retry –Speculative “contains” beginning the update Dagstuhl, Feberuary 2013

Teaching Help… Eran Yahav and I are planning a seminar on papers in the intersection of PL and DC Please offer suggestions… Don’t be shy about your own work. You are also welcome to come and give a talk… Dagstuhl, Feberuary 2013