{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

A14_DataRaceDectection - Dynamic Data Race Detection...

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

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

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

View Full Document Right 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
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
Image of page 3

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

View Full Document Right 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.
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]; }
Image of page 5

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

View Full Document Right 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.
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
Image of page 7

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

View Full Document Right 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.
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)
Image of page 9

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern