A14_DataRaceDectection - Dynamic Data Race Detection...

Info iconThis preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
Dynamic Data Race Detection
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Sources Eraser: A Dynamic Data Race Detector for Multithreaded Programs Stefan Savage, Michael Burrows, Greg Nelson, Patric Sobalvarro, Thomas Anderson, ACM Transactions on Computer Systems, Vol. 15, No. 4, November 1997 RaceTrack: Efficient Detection of Data Race Conditions via Adaptive Tracking; Yuan Yu, Tom Rodeheffer, Wei Chen, Proceedings SOSP ’05, copyright 2005 ACM
Background image of page 2
The Shared Problem Problem: Data race detection in multithreaded programs. (Implies shared memory) Solution: a tool that automates the problem of detecting potential data races Each paper describes a different method or technique Basic idea: look for “unprotected” accesses to shared variables. Why important: synchronization errors based on data races are Timing dependent Hard to find
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Data Race “A data race occurs when two concurrent threads access a shared variable and … at least one access is a write and the threads use no explicit mechanism to prevent the accesses from being simultaneous” In other words, a data race can lead to a potential violation of mutual exclusion.
Background image of page 4
Data Race Example: Threads with unsynchronized access to a shared array Thread 1 int i; for (i = 1; i < MAX; i++) { cin >> x; A[i] = 2*x; } Thread 2 int i; for (i = 1; i < MAX; i++) { if (A[i] < B[i]) B[i] = A[i]; }
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Approaches to Data Race Detection Static: performed at compile time or earlier Dynamic: runtime analysis Most current research focuses on dynamic detection The environment is a single multithreaded program rather than separate programs.
Background image of page 6
Static Data Race Detection Type-based analysis Language type system augmented to “express common synchronization relationships”: correct typing→no data races Difficult to do & restricts the type of synchronization primitives Language features e.g., use of monitors Only works for static data – not dynamic data Path analysis; Doesn’t scale well Too many false positives
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Dynamic Data Race Detection Dynamic detection: monitor programs during execution and look for problems The program may be “instrumented” with additional instructions The additions don’t change program functionality but are used to monitor conditions of interest - in this case, access to shared variables and synchronization operations.
Background image of page 8
Dynamic Detection Post mortem or on-the-fly analysis of code traces Problems: Can only check paths that are actually executed Adds overhead at runtime Techniques Happens-before (earliest dynamic technique) Lockset analysis (Eraser) Various hybrids (RaceTrack)
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Lock Definition Lock : a synchronization object that is either available, or owned (by a thread). Operations:
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 46

A14_DataRaceDectection - Dynamic Data Race Detection...

This preview shows document pages 1 - 11. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online