Eraser: A Dynamic Data Race Detector for Multithreaded Programs - - PowerPoint PPT Presentation

eraser a dynamic data race detector for multithreaded
SMART_READER_LITE
LIVE PREVIEW

Eraser: A Dynamic Data Race Detector for Multithreaded Programs - - PowerPoint PPT Presentation

Eraser: A Dynamic Data Race Detector for Multithreaded Programs Review Introduce tool to help eliminate data races Threads must use mutex locks Finds bugs during dynamic executions Checks shared variables on heap or global vars


slide-1
SLIDE 1

Eraser: A Dynamic Data Race Detector for Multithreaded Programs

slide-2
SLIDE 2

Review

 Introduce tool to help eliminate data races

 Threads must use mutex locks  Finds bugs during dynamic executions  Checks shared variables on heap or global vars  Locks at “right” granularity

 Assumption?

 Correct program holds a specific lock when

accessing shared data

slide-3
SLIDE 3

How?

 Lockset algorithm:

 Determines association of locks and data  Tracks lock set C(v) that could be associated

with shared variable

 If lock set becomes empty, sync error reported

slide-4
SLIDE 4

Example #1

Code: lock(A) x = x + 1 unlock(A) lock(B) x = x + 1 unlock(B)

slide-5
SLIDE 5

Example #2

Thread 1: lock(A) if x > 5: z = x + 1 else: z = 0 unlock(A) Thread 2: x = 10

slide-6
SLIDE 6

Alternative Methods

 Monitors

 Object-oriented  Methods perform locks on instance variables

 Static Analysis

 Advantages?  Disadvantages?