Shared variables initialized without holding a lock
description
Transcript of Shared variables initialized without holding a lock
Data RacesEraser: A Dynamic Data Race Detector for Multithreaded Programs
STEFAN SAVAGE, MICHAEL BURROWS, GREG NELSON, PATRICK SOBALVARRO, THOMAS ANDERSON
ACM Transactions on Computer Systems, Vol. 15, No. 4, November 1997
• Shared variables initialized without holding a lock -- initializing thread allocates data and knows that no other thread holds a reference to it.-- Solution: Delay the refinement of candidate set until variable’s initialization is complete.
Reading Shared Data
• After initialization, the data is read only• Simultaneous reads to a variable are not
races; thus, no need to protect with a lock.• Report races only after initialized variable has
become “write-shared” by more than one thread.
Checking in shared-modifiedstate