D THREADS : Efficient and Deterministic Multithreading

Multithreaded programming is notoriously difficult to get right. A key problem is non-determinism, which complicates debugging, testing, and reproducing errors in multithreaded applications. One way to simplify multithreaded programming is to enforce deterministic execution. However, past deterministic systems are incomplete or impractical. Language-based approaches require programmers to write their code in specialized languages. Other systems require program modification, do not ensure determinism in the presence of data races, do not work with general-purpose multithreaded programs, or suffer substantial performance penalties (up to 8× slower than pthreads) that limit their usefulness. This paper presents DTHREADS, an efficient deterministic multithreading system for unmodified C/C++ applications. DTHREADS not only prevents semantic errors like race conditions and deadlocks, but also can enhance performance by eliminating false sharing of cache lines. DTHREADS leverages virtual memory and process isolation, combined with a deterministic commit protocol, to ensure robust deterministic execution with low runtime overhead. Experimental results show that DTHREADS substantially outperforms a state-of-the-art deterministic runtime system, and often matches—and occasionally exceeds—the performance of pthreads.

[1]  James W. Havender Avoiding Deadlock in Multitasking Systems , 1968, IBM Syst. J..

[2]  Thomas J. LeBlanc,et al.  Debugging Parallel Programs with Instant Replay , 1987, IEEE Transactions on Computers.

[3]  Charles E. McDowell,et al.  Debugging concurrent programs , 1989, ACM Comput. Surv..

[4]  Willy Zwaenepoel,et al.  Implementation and performance of Munin , 1991, SOSP '91.

[5]  Richard H. Carver,et al.  Replay and testing for concurrent programs , 1991, IEEE Software.

[6]  Barton P. Miller,et al.  What are race conditions?: Some issues and formalizations , 1992, LOPL.

[7]  Alan L. Cox,et al.  TreadMarks: Distributed Shared Memory on Standard Workstations and Operating Systems , 1994, USENIX Winter.

[8]  Fred B. Schneider,et al.  Hypervisor-based fault tolerance , 1996, TOCS.

[9]  Jong-Deok Choi,et al.  Deterministic replay of Java multithreaded applications , 1998, SPDT '98.

[10]  F. Warren Burton,et al.  Space Efficient Execution of Deterministic Parallel Programs , 1999, IEEE Trans. Software Eng..

[11]  Kathryn S. McKinley,et al.  Hoard: a scalable memory allocator for multithreaded applications , 2000, SIGP.

[12]  Vikram S. Adve,et al.  LLVM: a compilation framework for lifelong program analysis & transformation , 2004, International Symposium on Code Generation and Optimization, 2004. CGO 2004..

[13]  Emery D. Berger,et al.  DieHard: probabilistic memory safety for unsafe languages , 2006, PLDI '06.

[14]  David Lie,et al.  Relaxed Determinism: Making Redundant Execution on Multiprocessors Practical , 2007, HotOS.

[15]  Christoforos E. Kozyrakis,et al.  Evaluating MapReduce for Multi-core and Multiprocessor Systems , 2007, 2007 IEEE 13th International Symposium on High Performance Computer Architecture.

[16]  Vikram S. Adve,et al.  A type and effect system for deterministic parallel Java , 2009, OOPSLA '09.

[17]  Emery D. Berger,et al.  Grace: safe multithreaded programming for C/C++ , 2009, OOPSLA '09.

[18]  Marek Olszewski,et al.  Kendo: efficient deterministic multithreading in software , 2009, ASPLOS.

[19]  Sriram K. Rajamani,et al.  ISOLATOR: dynamically ensuring isolation in comcurrent programs , 2009, ASPLOS.

[20]  Sebastian Burckhardt,et al.  Deconstructing concurrency heisenbugs , 2009, 2009 31st International Conference on Software Engineering - Companion Volume.

[21]  Christian Bienia,et al.  PARSEC 2.0: A New Benchmark Suite for Chip-Multiprocessors , 2009 .

[22]  Sebastian Burckhardt,et al.  Concurrent programming with revisions and isolation types , 2010, OOPSLA.

[23]  Zhiqiang Ma,et al.  Ad Hoc Synchronization Considered Harmful , 2010, OSDI.

[24]  Pravesh Kothari,et al.  A randomized scheduler with probabilistic guarantees of finding bugs , 2010, ASPLOS XV.

[25]  Junfeng Yang,et al.  Stable Deterministic Multithreading through Schedule Memoization , 2010, OSDI.

[26]  BurckhardtSebastian,et al.  Concurrent programming with revisions and isolation types , 2010 .

[27]  Luis Ceze,et al.  Deterministic Process Groups in dOS , 2010, OSDI.

[28]  Dan Grossman,et al.  CoreDet: a compiler and runtime system for deterministic multithreaded execution , 2010, ASPLOS XV.