MULTIVIE W Slide 1 (of 21) Software Transactional Memory Should Not Be Obstruction Free Paper: Robert Ennals Presenter: Emerson Murphy-Hill.

Slides:



Advertisements
Similar presentations
Categories of I/O Devices
Advertisements

Part IV: Memory Management
1 Concurrency Control Chapter Conflict Serializable Schedules  Two actions are in conflict if  they operate on the same DB item,  they belong.
Practice Session 7 Synchronization Liveness Deadlock Starvation Livelock Guarded Methods Model Thread Timing Busy Wait Sleep and Check Wait and Notify.
Concurrency: Deadlock and Starvation Chapter 6. Deadlock Permanent blocking of a set of processes that either compete for system resources or communicate.
Transactional Locking Nir Shavit Tel Aviv University (Joint work with Dave Dice and Ori Shalev)
Chapter 6: Process Synchronization
Mutual Exclusion.
Concurrency The need for speed. Why concurrency? Moore’s law: 1. The number of components on a chip doubles about every 18 months 2. The speed of computation.
Software Transactional Memory Should Not Be Obstruction Free Robert Ennals Intel Research Cambridge 15 JJ Thomson Avenue, Cambridge, CB3 0FD, UK
COS 461 Fall 1997 Transaction Processing u normal systems lose their state when they crash u many applications need better behavior u today’s topic: how.
Thread-Level Transactional Memory Decoupling Interface and Implementation UW Computer Architecture Affiliates Conference Kevin Moore October 21, 2004.
Transactional Memory (TM) Evan Jolley EE 6633 December 7, 2012.
1 CMSC421: Principles of Operating Systems Nilanjan Banerjee Principles of Operating Systems Acknowledgments: Some of the slides are adapted from Prof.
PARALLEL PROGRAMMING with TRANSACTIONAL MEMORY Pratibha Kona.
Presented by: Ofer Kiselov & Omer Kiselov Supervised by: Dmitri Perelman Final Presentation.
TOWARDS A SOFTWARE TRANSACTIONAL MEMORY FOR GRAPHICS PROCESSORS Daniel Cederman, Philippas Tsigas and Muhammad Tayyab Chaudhry.
CS510 Concurrent Systems Class 2 A Lock-Free Multiprocessor OS Kernel.
CS510 Concurrent Systems Class 13 Software Transactional Memory Should Not be Obstruction-Free.
©Brooks/Cole, 2003 Chapter 7 Operating Systems Dr. Barnawi.
Software Transaction Memory for Dynamic-Sized Data Structures presented by: Mark Schall.
The Structure of the “THE” -Multiprogramming System Edsger W. Dijkstra Jimmy Pierce.
CPS110: Implementing threads/locks on a uni-processor Landon Cox.
Transaction. A transaction is an event which occurs on the database. Generally a transaction reads a value from the database or writes a value to the.
CSE 486/586 CSE 486/586 Distributed Systems PA Best Practices Steve Ko Computer Sciences and Engineering University at Buffalo.
Operating System Review September 10, 2012Introduction to Computer Security ©2004 Matt Bishop Slide #1-1.
Nachos Phase 1 Code -Hints and Comments
Software Transactional Memory for Dynamic-Sized Data Structures Maurice Herlihy, Victor Luchangco, Mark Moir, William Scherer Presented by: Gokul Soundararajan.
111 © 2002, Cisco Systems, Inc. All rights reserved.
CS5204 – Operating Systems Transactional Memory Part 2: Software-Based Approaches.
ECE200 – Computer Organization Chapter 9 – Multiprocessors.
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.
Games Development 2 Concurrent Programming CO3301 Week 9.
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.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Deadlocks II.
Overview of DBMS recovery and concurrency control: Eksemplerne er fra kapitel 3 I bogen: Lars Fank Databaser Teori og Praksis ISBN
Deadlock Detection and Recovery
Software Transactional Memory Should Not Be Obstruction-Free Robert Ennals Presented by Abdulai Sei.
13-1 Chapter 13 Concurrency Topics Introduction Introduction to Subprogram-Level Concurrency Semaphores Monitors Message Passing Java Threads C# Threads.
Thread basics. A computer process Every time a program is executed a process is created It is managed via a data structure that keeps all things memory.
CS333 Intro to Operating Systems Jonathan Walpole.
CSCI1600: Embedded and Real Time Software Lecture 17: Concurrent Programming Steven Reiss, Fall 2015.
Scalable Computing model : Lock free protocol By Peeyush Agrawal 2010MCS3469 Guided By Dr. Kolin Paul.
Java Thread Programming
Distributed Databases – Advanced Concepts Chapter 25 in Textbook.
Concurrency: Deadlock and Starvation
Background on the need for Synchronization
Part 2: Software-Based Approaches
Faster Data Structures in Transactional Memory using Three Paths
Concurrency Control.
Two phase commit.
Operating System Reliability
Operating System Reliability
Outline Announcements Fault Tolerance.
Operating System Reliability
Operating System Reliability
Chapter 10 Transaction Management and Concurrency Control
Shared Memory Programming
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
Prof. Leonardo Mostarda University of Camerino
Locking Protocols & Software Transactional Memory
Operating System Reliability
- When you approach operating system concepts there might be several confusing terms that may look similar but in fact refer to different concepts:  multiprogramming, multiprocessing, multitasking,
Controlled Interleaving for Transactions
Operating System Reliability
Operating System Reliability
Presentation transcript:

MULTIVIE W Slide 1 (of 21) Software Transactional Memory Should Not Be Obstruction Free Paper: Robert Ennals Presenter: Emerson Murphy-Hill

MULTIVIE W Slide 2 (of 21) What We’ve Seen Thus Far… Hardware and software transactions No performance data STM striving to be obstruction-free: –A process will make progress in a finite number of steps in the absence of contention –The weakest progress guarantee –Introduces the possibility of livelock, which can be addressed through contention management (helping / stealing) The message: the weaker the progress guarantee, the simpler the implementation…

MULTIVIE W Slide 3 (of 21) The Gist of this Paper: Obstruction-freedom is an unnecessary guarantee for transactional memory Obstruction-freedom makes implementation difficult Without obstruction-freedom, performance is fine

MULTIVIE W Slide 4 (of 21) Threads In real programs, concurrency is implemented with threads Threads are used for convenience: –No performance advantage for single-core machines –Convenience allows one thread to proceed while another blocks –For instance, GUI and compute threads –Only locks needed; that’s fine for single-core –Different priority locks may be needed to ensure low priority threads don’t block high priority threads

MULTIVIE W Slide 5 (of 21) Threads (continued) Threading for performance: –In the presence of multi-cores, multi-threads are good! We expect locks in threaded code converted to transactions automatically The key: since the original, locked code could block a process, it’s acceptable for the new STM code to block as well

MULTIVIE W Slide 6 (of 21) Obstruction Freedom is Unnecessary

MULTIVIE W Slide 7 (of 21) Long Running Transactions Block Others Straw-man or Herlihy: long-running/non- terminating transactions can cause other transactions to block without obstruction- freedom Wrong! This happens anyway: –Suppose we have a read to an object, a year- long compute, then a write to the same object –All STM implementations can only block other transactions

MULTIVIE W Slide 8 (of 21) Context Switching Straw-man or Herlihy: the system grinds to a halt when the OS switches tasks Wrong! Here’s why: –The task will be switched back in again –In a good implementation, this will be rare, because the number of tasks should equal the number of processors –There should be no blocking in transactions anyway: It wasn’t allowed in the original locked implementation Transaction-aware operating systems can prevent it

MULTIVIE W Slide 9 (of 21) Independent Failure Straw-man or Herlihy: On software or hardware failure, system grinds to halt Wrong! –Software or hardware failure broke the lock- based implementation, so it’s fine –Hardware failure is rare in multi-cores anyway

MULTIVIE W Slide 10 (of 21) Obstruction Freedom makes Implementation Difficult

MULTIVIE W Slide 11 (of 21) Cache-locality STM usually requires several memory accesses before an object can be accessed What if one process wants to access an object owned by swapped- out process? –Wait, but that’s not obstruction-free –Go ahead, but that’s not safe –Could abort the blocked process and wait for acknowledgement, but that’s not obstruction-free either (also, might live-lock) So: STM cannot store object data in-place

MULTIVIE W Slide 12 (of 21) Excessive Active Transactions If there are N transactions on N processors, what happens if we want to add another transaction? Obstruction-free implementations can’t wait for other transactions to complete, so memory contention must increase

MULTIVIE W Slide 13 (of 21) Life without Obstruction- Freedom…

MULTIVIE W Slide 14 (of 21) The Basic Idea Revocable Two Phase Locking for Writes –A transaction locks all objects it intends to write –Locks are released when transaction is complete –On deadlock, one transaction aborts and rolls back it’s writes Optimistic Concurrency Control for Reads –Objects log the version number they read –Version numbers must match end-of-transaction version numbers on commit

MULTIVIE W Slide 15 (of 21) Memory Layout

MULTIVIE W Slide 16 (of 21) Reading and Writing To write to an object: –If the object’s handle is a version number CAS handle to point to new write descriptor Make private working copy –If the object’s handle is a write descriptor, wait Until it is a version number Or a timeout has been reached, then request other process to abort –On deadlock, system aborts one transaction To read from an object –Wait for handle to become a version –Log the version

MULTIVIE W Slide 17 (of 21) Committing Make sure all read objects still have same version Write working copy to original object Set object’s descriptor to a new version The runtime must periodically check for invalid transactions (transactions that are in infinite loops because they’ve seen inconsistent data)

MULTIVIE W Slide 18 (of 21) Performance

MULTIVIE W Slide 19 (of 21) Performance (continued)

MULTIVIE W Slide 20 (of 21) Performance (continued)

MULTIVIE W Slide 21 (of 21) Conclusion Obstruction freedom is not important to software transactional memory systems Obstruction freedom makes implementations: –Inefficient –Complicated So do away with it!