skip to main content
10.1145/1736020.1736029acmconferencesArticle/Chapter ViewAbstractPublication PagesasplosConference Proceedingsconference-collections
research-article

CoreDet: a compiler and runtime system for deterministic multithreaded execution

Authors Info & Claims
Published:13 March 2010Publication History

ABSTRACT

The behavior of a multithreaded program does not depend only on its inputs. Scheduling, memory reordering, timing, and low-level hardware effects all introduce nondeterminism in the execution of multithreaded programs. This severely complicates many tasks, including debugging, testing, and automatic replication. In this work, we avoid these complications by eliminating their root cause: we develop a compiler and runtime system that runs arbitrary multithreaded C/C++ POSIX Threads programs deterministically.

A trivial non-performant approach to providing determinism is simply deterministically serializing execution. Instead, we present a compiler and runtime infrastructure that ensures determinism but resorts to serialization rarely, for handling interthread communication and synchronization. We develop two basic approaches, both of which are largely dynamic with performance improved by some static compiler optimizations. First, an ownership-based approach detects interthread communication via an evolving table that tracks ownership of memory regions by threads. Second, a buffering approach uses versioned memory and employs a deterministic commit protocol to make changes visible to other threads. While buffering has larger single-threaded overhead than ownership, it tends to scale better (serializing less often). A hybrid system sometimes performs and scales better than either approach individually.

Our implementation is based on the LLVM compiler infrastructure. It needs neither programmer annotations nor special hardware. Our empirical evaluation uses the PARSEC and SPLASH2 benchmarks and shows that our approach scales comparably to nondeterministic execution.

References

  1. S. Adve and M. Hill. Weak Ordering -- A New Definition. In ISCA, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. E. Berger, K. McKinley, R. Blumofe, and P. Wilson. Hoard: A Scalable Memory Allocator for Multithreaded Applications. In ASPLOS, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. E. Berger, T. Yang, T. Liu, D. Krishnan, and A. Novark. Grace: Safe and Efficient Concurrent Programming. In OOPSLA, 2009.Google ScholarGoogle Scholar
  4. C. Bienia, S. Kumar, J. P. Singh, and K. Li. The PARSEC Benchmark Suite: Characterization and Architectural Implications. In PACT, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. G. Blelloch. NESL: A Nested Data-Parallel Language (Version 3.1). Technical report, Carnegie Mellon University, Pittsburgh, PA.Google ScholarGoogle Scholar
  6. R. Bocchino, V. Adve, D. Dig, S. Adve, S. Heumann, R. Komuravelli, J. Overbey, P. Simmons, H. Sung, and M. Vakilian. A Type and Effect System for Deterministic Parallel Java. In OOPSLA, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. H.-J. Boehm. Threads Cannot be Implemented as a Library. In PLDI, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. H.-J. Boehm and S. Adve. Foundations of the C++ Concurrency Memory Model. In PLDI, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. M. M. T. Chakravarty, R. Leshchinskiy, S. P. Jones, G. Keller, and S. Marlow. Data Parallel Haskell: A Status Report. In Workshop on Declarative Aspects of Multicore Programming (DAMP), 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. J. Devietti, B. Lucia, L. Ceze, and M. Oskin. DMP: Deterministic Shared Memory Multiprocessing. In ASPLOS, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. . A. Edwards and O. Tardieu. SHIM: A Deterministic Model for Heterogeneous Embedded Systems. In EMSOFT, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. M. Hill and M. Xu. Racey: A Stress Test for Deterministic Execution. http://www.cs.wisc.edu/~markhill/racey.html.Google ScholarGoogle Scholar
  13. D. Hower and M. Hill. ReRun: Exploiting Episodes for Lightweight Memory Race Recording. In ISCA, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. J. Choi and H. Srinivasan. Deterministic Replay of Java Multithreaded Applications. In SIGMETRICS SPDT, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. C. Lattner. Macroscopic Data Structure Analysis and Optimization. PhD thesis, Computer Science Dept., University of Illinois at Urbana-Champaign, Urbana, IL, May 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. C. Lattner and V. Adve. LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation. In CGO, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. T. J. LeBlanc and J. M. Mellor-Crummey. Debugging Parallel Programs with Instant Replay. IEEE TOC, 36(4), 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. J. Manson, W. Pugh, and S. Adve. The Java Memory Model. In POPL, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. J. Mellor-Crummey and M. Scott. Algorithms for scalable synchronization on shared-memory multiprocessors. ACM TOCS, 9(1), 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. P. Montesinos, L. Ceze, and J. Torrellas. DeLorean: Recording and Deterministically Replaying Shared-Memory Multiprocessor Execution Efficiently. In ISCA, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. M. Musuvathi, S. Qadeer, T. Ball, G. Basler, P. A. Nainar, and I. Neamtiu. Finding and Reproducing Heisenbugs in Concurrent Programs. In OSDI, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. S. Narayanasamy, C. Pereira, and B. Calder. Recording Shared Memory Dependencies Using Strata. In ASPLOS, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. M. Olszewski, J. Ansel, and S. Amarasinghe. Kendo: Efficient Deterministic Multithreading in Software. In ASPLOS, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. M. Rinard and M. Lam. The Design, Implementation, and Evaluation of Jade. ACM TOPLAS, 20(3), 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. M. Ronsse and K. De Bosschere. RecPlay: A Fully Integrated Practical Record/Replay System. ACM TOCS, 17(2), 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. W. Thies, M. Karczmarek, and S. Amarasinghe. StreamIt: A Language for Streaming Applications. In CC, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. S. C. Woo, M. Ohara, E. Torrie, J. P. Singh, and A. Gupta. The SPLASH-2 Programs: Characterization and Methodological Considerations. In ISCA, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. M. Xu, R. Bodik, and M. Hill. A "Flight Data Recorder" for Enabling Full-System Multiprocessor Deterministic Replay. In ISCA, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. CoreDet: a compiler and runtime system for deterministic multithreaded execution

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!