Thomas Ball Principal Researcher Microsoft Corporation Sebastian Burckhardt Researcher Microsoft Corporation Madan Musuvathi Researcher Microsoft Corporation Shaz Qadeer Senior Researcher Microsoft Corporation TL58
Madan Musuvathi Researcher Microsoft Corporation
Madan Musuvathi Researcher Microsoft Corporation
CAP Memory Model bugs Memory Model bugs Monitors Coverage Repro Testing Data races Data races Debugging Visualization Unmanaged Program Unmanaged Program Windows Managed Program Managed Program.NET CLR Record the interleaving executed Drive the program along an interleaving Record the interleaving executed Drive the program along an interleaving
Kernel: Threads, Scheduler, Synchronization Objects Kernel: Threads, Scheduler, Synchronization Objects While(not done) { TestScenario() } While(not done) { TestScenario() } TestScenario() { … } Program CHESS CHESS runs the scenario in a loop Every run takes a different interleaving Every run is repeatable Win32/.NET Uses the CAP scheduler To control and direct interleavings Detect Assertion violations Deadlocks Dataraces Livelocks CAP
x = 1; … x = k; x = 1; … x = k; x = 1; … x = k; x = 1; … x = k; … n threads k steps each Goal: Scale CHESS to large programs (large k)
x = 1; if (p != 0) { x = p->f; } x = 1; if (p != 0) { x = p->f; } x = 1; if (p != 0) { x = 1; if (p != 0) { x = p->f; } x = p->f; } p = 0; Thread 1Thread 2 preemption non-preemption
x = 1; … x = k; x = 1; … x = k; x = 1; … x = k; x = 1; … x = k; … n threads k steps each
Thomas Ball Principal Researcher Microsoft Corporation
EnterCS(cs) if (p != 0) { x = p->f; } LeaveCS(cs) EnterCS(cs) if (p != 0) { x = p->f; } LeaveCS(cs) p = 0; Thread 1Thread 2
flag1 = true; if( !flag2 ) DoWork(); flag1 = true; if( !flag2 ) DoWork(); flag2 = true; if( !flag1 ) DoWork(); flag2 = true; if( !flag1 ) DoWork(); Thread 1Thread 2 // initial state volatile bool flag1 = false; volatile bool flag2 = false; // initial state volatile bool flag1 = false; volatile bool flag2 = false;
Please fill out your evaluation for this session at: This session will be available as a recording at:
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.