Eraser: A Dynamic Data Race Detector for Multithreaded ProgramsReviewIntroduce tool to help eliminate data racesThreads must use mutex locksFinds bugs during dynamic executionsChecks shared variables on heap or global varsLocks at “right” granularityAssumption?Correct program holds a specific lock when accessing shared dataHow?Lockset algorithm:Determines association of locks and dataTracks lock set C(v) that could be associated with shared variableIf lock set becomes empty, sync error reportedExample #1Code:lock(A)x = x + 1unlock(A)lock(B)x = x + 1unlock(B)Example #2Thread 1:lock(A)if x > 5: z = x + 1else: z = 0unlock(A)Thread 2:x = 10Alternative MethodsMonitorsObject-orientedMethods perform locks on instance variablesStatic
View Full Document