Why STMs Need Compilers (a war story) Maurice Herlihy Brown University.

Slides:



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

CPSC 388 – Compiler Design and Construction
Objects and Classes David Walker CS 320. Advanced Languages advanced programming features –ML data types, exceptions, modules, objects, concurrency,...
Functional Image Synthesis. Pan An image synthesis “language” Images are functions Continuous and infinite Embedded in a functional host language Reusable.
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 –
Hybrid Transactional Memory Nir Shavit MIT and Tel-Aviv University Joint work with Alex Matveev (and describing the work of many in this summer school)
Guy Korland Tel Aviv University CRAFTING A READY-TO-GO STM.
Chapter 8 Runtime Support. How program structures are implemented in a computer memory? The evolution of programming language design has led to the creation.
TOWARDS A SOFTWARE TRANSACTIONAL MEMORY FOR GRAPHICS PROCESSORS Daniel Cederman, Philippas Tsigas and Muhammad Tayyab Chaudhry.
Intermediate code generation. Code Generation Create linear representation of program Result can be machine code, assembly code, code for an abstract.
Objects and Classes David Walker CS 320. Advanced Languages advanced programming features –ML data types, exceptions, modules, objects, concurrency,...
Formalisms and Verification for Transactional Memories Vasu Singh EPFL Switzerland.
CS 536 Spring Intermediate Code. Local Optimizations. Lecture 22.
Precept 3 COS 461. Concurrency is Useful Multi Processor/Core Multiple Inputs Don’t wait on slow devices.
EPFL - March 7th, 2008 Interfacing Software Transactional Memory Simplicity vs. Flexibility Vincent Gramoli.
Runtime Environments Source language issues Storage organization
1 /26 Red-black tree properties Every node in a red-black tree is either black or red Every null leaf is black No path from a leaf to a root can have two.
Reference Book: Modern Compiler Design by Grune, Bal, Jacobs and Langendoen Wiley 2000.
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.
Intermediate Code. Local Optimizations
Department of Computer Science Presenters Dennis Gove Matthew Marzilli The ATOMO ∑ Transactional Programming Language.
Wrapping Up Copyright 2003, Keith D. Cooper, Ken Kennedy & Linda Torczon, all rights reserved.
Software Transaction Memory for Dynamic-Sized Data Structures presented by: Mark Schall.
PSUCS322 HM 1 Languages and Compiler Design II IR Code Optimization Material provided by Prof. Jingke Li Stolen with pride and modified by Herb Mayer PSU.
Query Processing Presented by Aung S. Win.
Making Object-Based STM Practical in Unmanaged Environments Torvald Riegel and Diogo Becker de Brum ( Dresden University of Technology, Germany)
P ARALLEL P ROCESSING I NSTITUTE · F UDAN U NIVERSITY 1.
©2009 HP Confidential1 A Proposal to Incorporate Software Transactional Memory (STM) Support in the Open64 Compiler Dhruva R. Chakrabarti HP Labs, USA.
Peephole Optimization Improve code by examining and changing a small sequence (peephole) of code at a time. Improve code by examining and changing a small.
Automatic Data Partitioning in Software Transactional Memories Torvald Riegel, Christof Fetzer, Pascal Felber (TU Dresden, Germany / Uni Neuchatel, Switzerland)
Software Transactional Memory for Dynamic-Sized Data Structures Maurice Herlihy, Victor Luchangco, Mark Moir, William Scherer Presented by: Gokul Soundararajan.
Extending Open64 with Transactional Memory features Jiaqi Zhang Tsinghua University.
Java Virtual Machine Case Study on the Design of JikesRVM.
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.
Architectural Design Yonsei University 2 nd Semester, 2014 Sanghyun Park.
COMPILERS Symbol Tables hussein suleman uct csc3003s 2007.
SXM: Software Transactional Memory in C# Maurice Herlihy.
A Consistency Framework for Iteration Operations in Concurrent Data Structures Yiannis Nikolakopoulos A. Gidenstam M. Papatriantafilou P. Tsigas Distributed.
WG5: Applications & Performance Evaluation Pascal Felber
Low-Overhead Software Transactional Memory with Progress Guarantees and Strong Semantics Minjia Zhang, 1 Jipeng Huang, Man Cao, Michael D. Bond.
Implementing Subprograms What actions must take place when subprograms are called and when they terminate? –calling a subprogram has several associated.
CS536 Semantic Analysis Introduction with Emphasis on Name Analysis 1.
Basic of Parallel Programming Library Subroutine : library functions that support parallelism New Constructs : language is extended to support parallelism.
Non-Blocking Concurrent Data Objects With Abstract Concurrency By Jack Pribble Based on, “A Methodology for Implementing Highly Concurrent Data Objects,”
Executing Parallel Programs with Potential Bottlenecks Efficiently Yoshihiro Oyama Kenjiro Taura Akinori Yonezawa {oyama, tau,
Threads cannot be implemented as a library Hans-J. Boehm (presented by Max W Schwarz)
Fortress Aaron Becker Abhinav Bhatele Hassan Jafri 2 May 2006.
Orca A language for parallel programming of distributed systems.
3C-1 Purity Typing Language semantics Inheritance model  Single vs. Multiple inheritance  Common root Modular mechanisms Generics Object Oriented Languages.
Software Transactional Memory Should Not Be Obstruction-Free Robert Ennals Presented by Abdulai Sei.
1 Compiler & its Phases Krishan Kumar Asstt. Prof. (CSE) BPRCE, Gohana.
CoreDet: A Compiler and Runtime System for Deterministic Multithreaded Execution Tom Bergan Owen Anderson, Joe Devietti, Luis Ceze, Dan Grossman To appear.
1 Structure of Compilers Lexical Analyzer (scanner) Modified Source Program Parser Tokens Semantic Analysis Syntactic Structure Optimizer Code Generator.
Lock-Free Binary Search Tree Presented by Joanna Helga.
Transactional Memory Student Presentation: Stuart Montgomery CS5204 – Operating Systems 1.
1 Structure of a Compiler Source Language Target Language Semantic Analyzer Syntax Analyzer Lexical Analyzer Front End Code Optimizer Target Code Generator.
Companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit Concurrent Skip Lists.
Maurice Herlihy, Victor Luchangco, Mark Moir, William N. Scherer III
Minh, Trautmann, Chung, McDonald, Bronson, Casper, Kozyrakis, Olukotun
Part 2: Software-Based Approaches
Semantic Analysis with Emphasis on Name Analysis
Optimization Code Optimization ©SoftMoore Consulting.
Maurice Herlihy, Victor Luchangco, Mark Moir, William N. Scherer III
Introduction to Abstract Data Types
Wrapping Up Copyright 2003, Keith D. Cooper, Ken Kennedy & Linda Torczon, all rights reserved. Students enrolled in Comp 412 at Rice University have explicit.
Tree A tree is a data structure in which each node is comprised of some data as well as node pointers to child nodes
Presentation transcript:

Why STMs Need Compilers (a war story) Maurice Herlihy Brown University

STM Interested in managed languages Java, C# Not C, C++ Synchronization based on objects, not addresses Strong isolation between transactional & non-transactional access

STM Libraries: DSTM 2003 Transactional “wrapper” for objects Cumbersome & error-prone // wrapper for node object TMObject xnode = … // explicit open RBNode node = xnode.openRead(); // next field is wrapper TMObject next = node.next;

STM Libraries: SXM 2005 Mark data types as atomic Use reflection & run-time code generation Not efficient (no global optimizations) [Atomic] // Atomic Red-Black Tree node public class RBNode { public int value; public Color color; public bool marked; public RBNode parent, left, right; public RBNode() { value = 0; color = Color.RED; parent = null; left = null; right = null; }

Current work Mark data types as atomic Compiler does the rest… [Atomic] // Atomic Red-Black Tree node public class RBNode { public int value; public Color color; public bool marked; public RBNode parent, left, right; public RBNode() { value = 0; color = Color.RED; parent = null; left = null; right = null; } // other methods }

Optimizations Whole object dataflow analysis call tree for non-virtual methods Pass context from method to method Every method is analyzed for: Local objects (not shared across transactions) Read only or read/write objects Promotes openReads to openWrites for RW objects Early opens for objects used across basic blocks Partial Redundancy Elimination (PRE)

Optimizations (cont.) First vs. subsequent read/writes Inline subsequent reads/writes with fast-path code sequence Subsequent reads/writes are lock-free, even in the STM mode that uses short locks

Progress Conditions Short-lived locks Blocking Efficient library implementation Obstruction-free No locks, non-blocking Inefficient library implemenetation After compiler optimizations, obstruction-free performs as well as lock- based

Performance Comparison

Moral of the story Libraries are either Low-overhead but hard to use Inefficient but easy to use Compiler support Combines best of both worlds Non-local optimization