CS533 Concepts of Operating Systems Class 3 Data Races and the Case Against Threads.

Slides:



Advertisements
Similar presentations
Reduction, abstraction, and atomicity: How much can we prove about concurrent programs using them? Serdar Tasiran Koç University Istanbul, Turkey Tayfun.
Advertisements

Goldilocks: Efficiently Computing the Happens-Before Relation Using Locksets Tayfun Elmas 1, Shaz Qadeer 2, Serdar Tasiran 1 1 Koç University, İstanbul,
Chapter 6: Process Synchronization
5.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 5: CPU Scheduling.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 6: Process Synchronization.
CH7 discussion-review Mahmoud Alhabbash. Q1 What is a Race Condition? How could we prevent that? – Race condition is the situation where several processes.
Eraser: A Dynamic Data Race Detector for Multithreaded Programs STEFAN SAVAGE, MICHAEL BURROWS, GREG NELSON, PATRICK SOBALVARRO and THOMAS ANDERSON.
Dynamic Data Race Detection. Sources Eraser: A Dynamic Data Race Detector for Multithreaded Programs –Stefan Savage, Michael Burrows, Greg Nelson, Patric.
Today’s Agenda  Midterm: Nov 3 or 10  Finish Message Passing  Race Analysis Advanced Topics in Software Engineering 1.
CS 162 Week 3 Discussion (2/13 – 2/14). Today’s Section Project Administrivia (5 min) Quiz (5 min) Review Lectures 6 and 7 (15 min) Worksheet and Discussion.
Atomicity in Multi-Threaded Programs Prachi Tiwari University of California, Santa Cruz CMPS 203 Programming Languages, Fall 2004.
/ PSWLAB Atomizer: A Dynamic Atomicity Checker For Multithreaded Programs By Cormac Flanagan, Stephen N. Freund 24 th April, 2008 Hong,Shin.
CS 263 Course Project1 Survey: Type Systems for Race Detection and Atomicity Feng Zhou, 12/3/2003.
TaintCheck and LockSet LBA Reading Group Presentation by Shimin Chen.
CS294, YelickESC, p1 CS Extended Static Checking
Chapter 6: Process Synchronization. Outline Background Critical-Section Problem Peterson’s Solution Synchronization Hardware Semaphores Classic Problems.
CS533 - Concepts of Operating Systems 1 Anyone NOT on this list see me after class! Bock, Tony Carroll, Diana Kulkarni, Ashwini LeVitre, Jon Mukherjee,
Chapter 6: Process Synchronization. 6.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 8, 2005 Objectives Understand.
Semaphores, mutexes and condition variables. semaphores Two types – Binary – 0 or 1 – Counting 0 to n Wait – decrements > 0 forces a wait Post or signal.
Runtime Atomicity Analysis of Multi-threaded Programs Focus is on the paper: “Atomizer: A Dynamic Atomicity Checker for Multithreaded Programs” by C. Flanagan.
CS533 Concepts of Operating Systems Class 1
CS533 Concepts of Operating Systems Class 3 Monitors.
1 Chapter 6: Concurrency: Mutual Exclusion and Synchronization Operating System Spring 2007 Chapter 6 of textbook.
CS533 - Concepts of Operating Systems 1 CS533 Concepts of Operating Systems Class 8 Synchronization on Multiprocessors.
CS533 - Concepts of Operating Systems 1 Class Discussion.
CS510 Concurrent Systems Class 5 Threads Cannot Be Implemented As a Library.
Parallelizing Data Race Detection Benjamin Wester Facebook David Devecsery, Peter Chen, Jason Flinn, Satish Narayanasamy University of Michigan.
/ PSWLAB Eraser: A Dynamic Data Race Detector for Multithreaded Programs By Stefan Savage et al 5 th Mar 2008 presented by Hong,Shin Eraser:
DETECTION OF POTENTIAL DEADLOCKS AND DATARACES ROZA GHAMARI Bogazici UniversityMarch 2009.
Operating Systems CSE 411 CPU Management Oct Lecture 13 Instructor: Bhuvan Urgaonkar.
CS510 Concurrent Systems Introduction to Concurrency.
Chapter 6 Process Synchronization Copyright © 2008.
CS533 Concepts of Operating Systems Jonathan Walpole.
Eraser: A Dynamic Data Race Detector for Multithreaded Programs STEFAN SAVAGE, MICHAEL BURROWS, GREG NELSON, PATRICK SOBALVARRO, and THOMAS ANDERSON Ethan.
50.530: Software Engineering Sun Jun SUTD. Week 8: Race Detection.
6.3 Peterson’s Solution The two processes share two variables: Int turn; Boolean flag[2] The variable turn indicates whose turn it is to enter the critical.
Critical Problem Revisit. Critical Sections Mutual exclusion Only one process can be in the critical section at a time Without mutual exclusion, results.
Dynamic Data Race Detection. Sources Eraser: A Dynamic Data Race Detector for Multithreaded Programs –Stefan Savage, Michael Burrows, Greg Nelson, Patric.
Chapter 6: Synchronization. 6.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Module 6: Synchronization Background The Critical-Section.
11/18/20151 Operating Systems Design (CS 423) Elsa L Gunter 2112 SC, UIUC Based on slides by Roy Campbell, Sam.
CS533 - Concepts of Operating Systems 1 Anyone NOT on this list see me after class! Arryadi, Rizal Carlson, Kristen Ellet, Burke Florey, David Greenwald,
Bugs (part 1) CPS210 Spring Papers  Bugs as Deviant Behavior: A General Approach to Inferring Errors in System Code  Dawson Engler  Eraser: A.
Chapter 6: Process Synchronization. 6.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Module 6: Process Synchronization Background The.
CS399 New Beginnings Jonathan Walpole. 2 Concurrent Programming & Synchronization Primitives.
1 Condition Variables CS 241 Prof. Brighten Godfrey March 16, 2012 University of Illinois.
CS527 Topics in Software Engineering (Software Testing and Analysis) Darko Marinov August 30, 2011.
Operating Systems CSE 411 CPU Management Dec Lecture Instructor: Bhuvan Urgaonkar.
Concurrency in Shared Memory Systems Synchronization and Mutual Exclusion.
HARD: Hardware-Assisted lockset- based Race Detection P.Zhou, R.Teodorescu, Y.Zhou. HPCA’07 Shimin Chen LBA Reading Group Presentation.
/ PSWLAB Thread Modular Model Checking by Cormac Flanagan and Shaz Qadeer (published in Spin’03) Hong,Shin Thread Modular Model.
Eraser: A dynamic Data Race Detector for Multithreaded Programs Stefan Savage, Michael Burrows, Greg Nelson, Patrick Sobalvarro, Thomas Anderson Presenter:
CS533 Concepts of Operating Systems Class 2a Monitors.
CS533 Concepts of Operating Systems Class 2 Overview of Threads and Concurrency.
Chapter 6 Synchronization Dr. Yingwu Zhu. The Problem with Concurrent Execution Concurrent processes (& threads) often access shared data and resources.
FastTrack: Efficient and Precise Dynamic Race Detection [FlFr09] Cormac Flanagan and Stephen N. Freund GNU OS Lab. 23-Jun-16 Ok-kyoon Ha.
Detecting Data Races in Multi-Threaded Programs
W4118 Operating Systems Instructor: Junfeng Yang.
Presenter: Godmar Back
Healing Data Races On-The-Fly
Instructor: Junfeng Yang
Process Synchronization
CS533 Concepts of Operating Systems Class 3
Process Synchronization
Critical section problem
Concurrency: Mutual Exclusion and Process Synchronization
CS533 Concepts of Operating Systems Class 3
CS333 Intro to Operating Systems
50.530: Software Engineering
Eraser: A dynamic data race detector for multithreaded programs
Process/Thread Synchronization (Part 2)
Presentation transcript:

CS533 Concepts of Operating Systems Class 3 Data Races and the Case Against Threads

CS533 - Concepts of Operating Systems 2 Useful programming conventions  All access to shared data must be potected by a mutex o All shared variables have a lock o The lock is held by the thread that accesses the variable  How can this be checked? o Statically? o Dynamically?

CS533 - Concepts of Operating Systems 3 Automated checking of conventions  Eraser o A dynamic checker that uses binary re-writing techniques o Gathers an “execution history” of reads, writes and lock acquisitions o Evaluates consistency with rules  Is it enough to simply check that some lock is held whenever a global variable is accessed?

CS533 - Concepts of Operating Systems 4 Automated checking of conventions  Eraser doesn’t know ahead of time which locks protect which variables  It infers which locks protect which variables using a lock-set algorithm o Assume all locks are candidates for a variable ( C(v) is full) o For each access take intersection of C(v) and locks held by thread and make these the candidate set C(v) o If C(v) becomes empty, issue warning

CS533 - Concepts of Operating Systems 5 Improving the locking discipline  The standard approach produces many false positives that arise due to special cases:  Initialization o No need to lock if no thread has a reference yet  Read sharing o No need to lock if all threads are readers  Reader/writer locking o Distinguish concurrent readers from concurrent readers and writers

CS533 - Concepts of Operating Systems 6 Improved algorithm virgin exclusive shared Modified (race?) rd, wr First thread wr rd, new thread wr, new thread wr rd