Eraser: A Dynamic Data Race Detector for Multi-Threaded Programs - Prof. Alan L. Sussman, Study notes of Computer Science

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

Pre 2010

Uploaded on 02/13/2009

koofers-user-g6v
koofers-user-g6v ๐Ÿ‡บ๐Ÿ‡ธ

9 documents

1 / 14

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Eraser
Eraser: A Dynamic Data Race Detector for
Multi-Threaded Programs
S. Savage, M. Burrows, G. Nelson, P.
Sobalvarro, T. Anderson
Serge Koren
CMSC714
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe

Partial preview of the text

Download Eraser: A Dynamic Data Race Detector for Multi-Threaded Programs - Prof. Alan L. Sussman and more Study notes Computer Science in PDF only on Docsity!

Eraser

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

Happens-before

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)