Shared variables initialized without holding a lock

26
Data Races Eraser: 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

description

Data Races Eraser: 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 - PowerPoint PPT Presentation

Transcript of Shared variables initialized without holding a lock

Page 1: 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

Page 2: Shared variables initialized without holding a lock
Page 3: Shared variables initialized without holding a lock
Page 4: Shared variables initialized without holding a lock
Page 5: Shared variables initialized without holding a lock
Page 6: Shared variables initialized without holding a lock
Page 7: Shared variables initialized without holding a lock
Page 8: Shared variables initialized without holding a lock
Page 9: Shared variables initialized without holding a lock
Page 10: Shared variables initialized without holding a lock
Page 11: Shared variables initialized without holding a lock
Page 12: Shared variables initialized without holding a lock
Page 13: Shared variables initialized without holding a lock
Page 14: Shared variables initialized without holding a lock

• 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.

Page 15: Shared variables initialized without holding a lock

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.

Page 16: Shared variables initialized without holding a lock
Page 17: Shared variables initialized without holding a lock

Checking in shared-modifiedstate

Page 18: Shared variables initialized without holding a lock
Page 19: Shared variables initialized without holding a lock
Page 20: Shared variables initialized without holding a lock
Page 21: Shared variables initialized without holding a lock
Page 22: Shared variables initialized without holding a lock
Page 23: Shared variables initialized without holding a lock
Page 24: Shared variables initialized without holding a lock
Page 25: Shared variables initialized without holding a lock
Page 26: Shared variables initialized without holding a lock