Programming Paradigms for Concurrency Part 2: Transactional Memories Vasu Singh

Slides:



Advertisements
Similar presentations
Transactional Memory Parag Dixit Bruno Vavala Computer Architecture Course, 2012.
Advertisements

The many faces of TM Tim Harris. Granularity Distributed, large-scale atomic actions Composable shared memory data structures Leaf shared memory data.
Concurrency Issues Motivation, Problems, Directions Dennis Kafura - CS Operating Systems1.
Concurrency: Mutual Exclusion and Synchronization Chapter 5.
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.
Operating System Concepts and Techniques Lecture 12 Interprocess communication-1 M. Naghibzadeh Reference M. Naghibzadeh, Operating System Concepts and.
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.
Transactional Memory (TM) Evan Jolley EE 6633 December 7, 2012.
An Case for an Interleaving Constrained Shared-Memory Multi- Processor CS6260 Biao xiong, Srikanth Bala.
PARALLEL PROGRAMMING with TRANSACTIONAL MEMORY Pratibha Kona.
Threading Part 2 CS221 – 4/22/09. Where We Left Off Simple Threads Program: – Start a worker thread from the Main thread – Worker thread prints messages.
1 Lecture 21: Transactional Memory Topics: consistency model recap, introduction to transactional memory.
1 Distributed Computing Algorithms CSCI Distributed Computing: everything not centralized many processors.
Formalisms and Verification for Transactional Memories Vasu Singh EPFL Switzerland.
Lock vs. Lock-Free memory Fahad Alduraibi, Aws Ahmad, and Eman Elrifaei.
1 Lecture 7: Transactional Memory Intro Topics: introduction to transactional memory, “lazy” implementation.
1 Lecture 23: Transactional Memory Topics: consistency model recap, introduction to transactional memory.
1 New Architectures Need New Languages A triumph of optimism over experience! Ian Watson 3 rd July 2009.
Concurrency and Software Transactional Memories Satnam Singh, Microsoft Faculty Summit 2005.
1 Concurrency: Deadlock and Starvation Chapter 6.
Why The Grass May Not Be Greener On The Other Side: A Comparison of Locking vs. Transactional Memory Written by: Paul E. McKenney Jonathan Walpole Maged.
1 © R. Guerraoui Seth Gilbert Professor: Rachid Guerraoui Assistants: M. Kapalka and A. Dragojevic Distributed Programming Laboratory.
Advances in Language Design
1 Concurrency: Deadlock and Starvation Chapter 6.
Multi Core Processor Submitted by: Lizolen Pradhan
15-740/ Oct. 17, 2012 Stefan Muller.  Problem: Software is buggy!  More specific problem: Want to make sure software doesn’t have bad property.
View-Oriented Parallel Programming for multi-core systems Dr Zhiyi Huang World 45 Univ of Otago.
Parallel and Distributed Systems Instructor: Xin Yuan Department of Computer Science Florida State University.
Chapter 2 Parallel Architecture. Moore’s Law The number of transistors on a chip doubles every years. – Has been valid for over 40 years – Can’t.
1 Computer Architecture Research Overview Focus on: Transactional Memory Rajeev Balasubramonian School of Computing, University of Utah
Parallel Processing Sharing the load. Inside a Processor Chip in Package Circuits Primarily Crystalline Silicon 1 mm – 25 mm on a side 100 million to.
WG5: Applications & Performance Evaluation Pascal Felber
Chapter 1 Performance & Technology Trends Read Sections 1.5, 1.6, and 1.8.
Transactional Memory Lecturer: Danny Hendler. 2 2 From the New York Times…
Multi-Core Development Kyle Anderson. Overview History Pollack’s Law Moore’s Law CPU GPU OpenCL CUDA Parallelism.
Memory Consistency Models. Outline Review of multi-threaded program execution on uniprocessor Need for memory consistency models Sequential consistency.
CS162 Week 5 Kyle Dewey. Overview Announcements Reactive Imperative Programming Parallelism Software transactional memory.
HXY Debugging Made by Contents 目录 History of Java MT Sequential & Parallel Different types of bugs Debugging skills.
Techniques and Structures in Concurrent Programming Wilfredo Velazquez.
Gauss Students’ Views on Multicore Processors Group members: Yu Yang (presenter), Xiaofang Chen, Subodh Sharma, Sarvani Vakkalanka, Anh Vo, Michael DeLisi,
On Transactional Memory, Spinlocks and Database Transactions Khai Q. Tran Spyros Blanas Jeffrey F. Naughton (University of Wisconsin Madison)
Page 1 2P13 Week 1. Page 2 Page 3 Page 4 Page 5.
Novel Paradigms of Parallel Programming Prof. Smruti R. Sarangi IIT Delhi.
Concurrency Idea. 2 Concurrency idea Challenge –Print primes from 1 to Given –Ten-processor multiprocessor –One thread per processor Goal –Get ten-fold.
Lecture 20: Consistency Models, TM
(Nested) Open Memory Transactions in Haskell
Minh, Trautmann, Chung, McDonald, Bronson, Casper, Kozyrakis, Olukotun
Andy Wang COP 5611 Advanced Operating Systems
Memory Consistency Models
Multicore Programming Final Review
Memory Consistency Models
Challenges in Concurrent Computing
EE 193: Parallel Computing
143a discussion session week 3
The University of Adelaide, School of Computer Science
Shared Memory Programming
Lecture 22: Consistency Models, TM
Chapter 1 Introduction.
Background and Motivation
Hybrid Transactional Memory
By Brandon, Ben, and Lee Parallel Computing.
Distributed Transactions
Concurrency: Mutual Exclusion and Process Synchronization
Distributed Computing:
EE 4xx: Computer Architecture and Performance Programming
CSE 153 Design of Operating Systems Winter 19
Lecture: Coherence and Synchronization
Lecture: Consistency Models, TM
Presentation transcript:

Programming Paradigms for Concurrency Part 2: Transactional Memories Vasu Singh

Computing Ubiquitous Ever increasing performance! Everyone expects computers to get faster But, what triggers this perennial performance gain?

Moore's Law Number of transistors per chip doubles once every two years

Moore's Law Hoped to continue to until around 2015

However, To get more speed, a processor needs higher chip frequency too Around 2003, chip manufacturers hit the “heat wall” Heat wall: Further increase in frequency would destroy the processor due to excessive heating (heat dissipation is cubic in chip frequency) ‏

Alternative to a faster processor Instead of making one processor faster, add more processors (keeps heat low, and the processor green) But, how do we make a program faster with multiple processors? Do multiple things in parallel A paradigm shift! This course is about this paradigm shift

Writing Sequential Programs: Easy X = X + 1 ; Y = Y + 1 ; Z = Z + 1 Correctness: At the end of the program, the variables X, Y, and Z must be incremented by 1.

Writing Parallel Programs: Harder The programmer must divide work for different processors The workers are known as “threads” Examples: X := X + 1 || Y := Y + 1 X := X + 1 || X := X + 1

Correctness of Parallel Programs The effect of the program should be as if all threads executed sequentially When threads do not share data X:= X+1 || Y:=Y+1 At the end of the program X and Y should be incremented by 1 Easy to guarantee When threads share data X := X+1 || X:=X+1 At the end of the program X should be incremented by 2 Not so easy to guarantee: need to make sure that threads do not interfere

Concurrency Different threads may work on the same data Concurrency: How the threads should interact so that they do not produce unexpected results Two paradigms: Shared memory concurrency (Pavol and I) Message passing concurrency (Thomas) ‏ We focus on shared memory concurrency now

Synchronization Parallel programs demand synchronization: a discipline for the threads to access shared variables Lack of synchronization leads to errors, commonly known as “concurrency bugs” For example: in (X:=X + 1 || X:=X + 1), when X is initially 0, we can get X=1

Demo Sequential Bank Account Synchronized Parallel Bank Account Unsynchronized Parallel Bank Account

Lock based Synchronization While using locks, you have to guarantee a few more things: Mutual exclusion Starvation freedom Deadlock freedom

Alternative programmer-friendly technique The programmer marks program fragments as transactions Demo

Transactional memory A piece of hardware/software that guarantees that program fragments marked as “transactions” do execute atomically

How does a TM work? The threads executes transactions. The transactions interact with the hardware via the transactional memory. The transactional memory keeps track of all accesses in the different transactions. If accesses of two threads conflict, the TM aborts the transactions.

Problems with TM Hard work pays: Performance of your program may not scale as with fine-grained locking Speculative execution: Several I/O issues inside transactions (remember, transactions may abort, and so a transaction should not produce any output until it is sure to commit) And many more… That's what this course is for!

Course Outline November 11: History of TM (dates back to 1991!) November 18: Correctness properties in TM, Examples, STM November 25: Formal Semantics of transactional programs December 2: Performance issues in implementing STM

Projects Seminar based (Study a set of coherent papers and summarize in a presentation and a report) Implementation based Implementation: task-driven efficient TM Verification: model checking, runtime verification Contact me, and we decide together

Thank You