








Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Eraser, a dynamic data race detector for multi-threaded programs developed by savage, burrows, nelson, sobalvarro, and anderson. The authors compare eraser to related approaches such as monitors and happens-before, and describe eraser's implementation and experience. They also discuss improvements to the lockset algorithm used by eraser and its limitations.
Typology: Study notes
1 / 14
This page cannot be seen from the preview
Don't miss anything!









Eraser: A Dynamic Data Race Detector for Multi-Threaded Programs S. Savage, M. Burrows, G. Nelson, P. Sobalvarro, T. Anderson Serge Koren CMSC
Outline โฒ (^) Introduction โฒ (^) Related approaches โฒ (^) Eraser's approach โฒ (^) Implementation/Experience โฒ (^) Conclusion
Related Approaches โ Monitors โ state and procedures together โ Happens-before โ Events ordered between threads based on synchronization objects they access โ More general, more costly โ Less thorough
Example โ (^) Program Locks_held C(v) {} {mu1, mu2} lock(mu1); v = v + 1; {mu1} {mu1} unlock(mu1); {} lock(mu2); v = v + 1; {mu2} unlock(mu2); {}, WARNING
Improving Lockset โ Initialization โ initialize a shared variable without holding lock โ Read-shared data โ written only at initialization and then read (no need for locks) โ Read-write locks โ read by multiple threads, written by only one at a time
Read-Write Locks โ Lock m protects v if m held in write for writes and in read/write for read โ On each read of variable, v, by thread, t โ Set C(v) = C(v) โฉ locks_held(t) โ (^) If C(v) = {}, issue warning โ On each write of variable, v, by thread, t โ Set C(v) = C(v) โฉ write_ locks_held(t) โ If C(v) = {}, issue warning
Implementation โ Instrument program โ Indexed table of lock sets (hashed and sorted) โ Shadow word โ Exists for every 32-bit data segment โ (^) State condition โ (^) Lockset index โ 10-30 times slower than without
Experience โ Tested on different code bases โ (^) Found true data races, found false alarms โ Effectiveness/Sensitivity โ Found data races that had existed before โ Works the same on two or ten threads โ Multiple locks โ Many read locks, write takes all read locks โ Deadlock detection using ordering of locks
Conclusion โ Little data on sensitivity โ Only works for locks (pthreads) โ Annotations needed โ Slow/doubled memory usage โ Multiple lock fix incorrect/unclear โ http://valgrind.org (Helgrind: a data-race detector)