skip to main content
10.1145/1806596.1806636acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
research-article

DRFX: a simple and efficient memory model for concurrent programming languages

Published:05 June 2010Publication History

ABSTRACT

The most intuitive memory model for shared-memory multithreaded programming is sequential consistency(SC), but it disallows the use of many compiler and hardware optimizations thereby impacting performance. Data-race-free (DRF) models, such as the proposed C++0x memory model, guarantee SC execution for datarace-free programs. But these models provide no guarantee at all for racy programs, compromising the safety and debuggability of such programs. To address the safety issue, the Java memory model, which is also based on the DRF model, provides a weak semantics for racy executions. However, this semantics is subtle and complex, making it difficult for programmers to reason about their programs and for compiler writers to ensure the correctness of compiler optimizations.

We present the DRFx memory model, which is simple for programmers to understand and use while still supporting many common optimizations. We introduce a memory model (MM) exception which can be signaled to halt execution. If a program executes without throwing this exception, then DRFx guarantees that the execution is SC. If a program throws an MM exception during an execution, then DRFx guarantees that the program has a data race. We observe that SC violations can be detected in hardware through a lightweight form of conflict detection. Furthermore, our model safely allows aggressive compiler and hardware optimizations within compiler-designated program regions. We formalize our memory model, prove several properties about this model, describe a compiler and hardware design suitable for DRFx, and evaluate the performance overhead due to our compiler and hardware requirements.

References

  1. S. V. Adve and M. D. Hill. Weak ordering--a new definition. In Proceedings of ISCA, pages 2--14. ACM, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. S. V. Adve, M. D. Hill, B. P. Miller, and R. H. B. Netzer. Detecting data races on weak memory systems. In ISCA, pages 234--243, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. W. Ahn, S. Qi, J.-W. Lee, M. Nicolaides, X. Fang, J. Torrellas, D. Wong, and S. Midkiff. Bulkcompiler: High-performance sequential consistency through cooperative compiler and hardware support. In 42nd International Symposium on Microarchitecture, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. C. Bienia, S. Kumar, J. P. Singh, and K. Li. The parsec benchmark suite: Characterization and architectural implications. In Proceedings of the 17th International Conference on Parallel Architectures and Compilation Techniques, October 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. C. Blundell, M. Martin, and T. Wenisch. Invisifence: performancetransparent memory ordering in conventional multiprocessors. In ISCA, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. H. J. Boehm. Simple thread semantics require race detection. In FIT session at PLDI, 2009.Google ScholarGoogle Scholar
  7. H. J. Boehm and S. Adve. Foundations of the c++ concurrency memory model. In Proceedings of PLDI, pages 68--78. ACM, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. C. Boyapati and M. Rinard. A parameterized type system for race-free Java programs. In Proceedings of OOPSLA, pages 56--69. ACM Press, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. C. Boyapati, R. Lee, and M. Rinard. Ownership types for safe programming: Preventing data races and deadlocks. In Proceedings of OOPSLA, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. P. Cenciarelli, A. Knapp, and E. Sibilio. The java memory model: Operationally, denotationally, axiomatically. In ESOP, pages 331--346, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. L. Ceze, J. Tuck, P. Montesinos, and J. Torrellas. Bulksc: bulk enforcement of sequential consistency. In ISCA, pages 278--289, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. L. Ceze, J. Devietti, B. Lucia, and S. Qadeer. The case for system support for concurrency exceptions. In USENIX HotPar, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. D. Dice, Y. Lev, M. Moir, and D. Nussbaum. Early experience with a commercial hardware transactional memory implementation. In Proceedings of ASPLOS, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. C. Flanagan and S. Freund. FastTrack: efficient and precise dynamic race detection. In Proceedings of PLDI, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. C. Flanagan and S. N. Freund. Type-based race detection for Java. In Proceedings of PLDI, pages 219--232, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. K. Gharachorloo and P. Gibbons. Detecting violations of sequential consistency. In Proceedings of the third annual ACM symposium on Parallel algorithms and architectures, pages 316--326. ACM New York, NY, USA, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. K. Gharachorloo, D. Lenoski, J. Laudon, P. Gibbons, A. Gupta, and J. Hennessy. Memory consistency and event ordering in scalable shared-memory multiprocessors. In Proceedings of ISCA, pages 15--26, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. L. Hammond, V. Wong, M. K. Chen, B. D. Carlstrom, J. D. Davis, B. Hertzberg, M. K. Prabhu, H. Wijaya, C. Kozyrakis, and K. Olukotun. Transactional memory coherence and consistency. In ISCA, pages 102--113, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. M. Herlihy and J. E. B. Moss. Transactional memory: architectural support for lock-free data structures. In Proceedings of ISCA, pages 289--300. ACM, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. A. Kamil, J. Su, and K. Yelick. Making sequential consistency practical in Titanium. In Proceedings of the 2005 ACM/IEEE conference on Supercomputing, page 15. IEEE Computer Society, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. A. Krishnamurthy and K. Yelick. Analyses and optimizations for shared address space programs. Journal of Parallel and Distributed Computing, 38(2):130--144, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. L. Lamport. Time, clocks, and the ordering of events in a distributed system. Communications of the ACM, 21(7):558--565, 1978. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. L. Lamport. How to make a multiprocessor computer that correctly executes multiprocess programs. IEEE transactions on computers, 100(28):690--691, 1979. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. C. Lattner and V. Adve. LLVM: A compilation framework for lifelong program analysis & transformation. In Proceedings of the international symposium on Code generation and optimization: feedbackdirected and runtime optimization. IEEE Computer Society, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. B. Liblit, A. Aiken, and K. Yelick. Type systems for distributed data sharing. In Proceedings of the Tenth International Static Analysis Symposium, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. B. Lucia, L. Ceze, K. Strauss, S. Qadeer, and H. Boehm. Conflict exceptions: Providing simple parallel language semantics with precise hardware exceptions. In 37th Annual International Symposium on Computer Architecture, June 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. C. K. Luk, R. Cohn, R.Muth, H. Patil, A. Klauser, G. Lowney, S.Wallace, V. J. Reddi, and K. Hazelwood. Pin: Building customized program analysis tools with dynamic instrumentation. In Programming Language Design and Implementation, Chicago, IL, June 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. J. Manson, W. Pugh, and S. Adve. The java memory model. In Proceedings of POPL, pages 378--391. ACM, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. D. Marino, A. Singh, T. Millstein, M. Musuvathi, and S. Narayanasamy. DRFx: A simple and efficient memory model for concurrent programming languages. Technical Report 090021, UCLA Computer Science Department, Nov. 2009. URL http://fmdb.cs.ucla.edu/Treports/090021.pdf.Google ScholarGoogle Scholar
  30. A. Muzahid, D. Suarez, S. Qi, and J. Torrellas. Sigrace: signaturebased data race detection. In ISCA, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. P. Pratikakis, J. S. Foster, and M. Hicks. Locksmith: context-sensitive correlation analysis for race detection. In Proceedings of PLDI, pages 320--331, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. M. Prvulovic and J. Torrelas. Reenact: Using thread-level speculation mechanisms to debug data races in multithreaded codes. In Proceedings of ISCA, San Diego, CA, June 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. P. Ranganathan, V. Pai, and S. Adve. Using speculative retirement and larger instruction windows to narrow the performance gap between memory consistency models. In Proceedings of the ninth annual ACM symposium on Parallel algorithms and architectures, pages 199--210, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. S. Sethumadhavan, R. Desikan, D. Burger, C. Moore, and S. Keckler. Scalable hardware memory disambiguation for high ILP processors. In Proceedings of the 36th annual IEEE/ACM International Symposium on Microarchitecture. IEEE Computer Society, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. J. Sevcík and D. Aspinall. On validity of program transformations in the java memory model. In ECOOP, pages 27--51, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. D. Shasha and M. Snir. Efficient and correct execution of parallel programs that share memory. ACM Transactions on Programming Languages and Systems (TOPLAS), 10(2):282--312, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Z. Sura, X. Fang, C. Wong, S. Midkiff, J. Lee, and D. Padua. Compiler techniques for high performance sequentially consistent java programs. In Proceedings of the tenth ACM SIGPLAN symposium on Principles and practice of parallel programming, pages 2--13, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. W. Triebel, J. Bissell, and R. Booth. Programming Itanium-based Systems. Intel Press, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. DRFX: a simple and efficient memory model for concurrent programming languages

        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
        • Published in

          cover image ACM Conferences
          PLDI '10: Proceedings of the 31st ACM SIGPLAN Conference on Programming Language Design and Implementation
          June 2010
          514 pages
          ISBN:9781450300193
          DOI:10.1145/1806596
          • cover image ACM SIGPLAN Notices
            ACM SIGPLAN Notices  Volume 45, Issue 6
            PLDI '10
            June 2010
            496 pages
            ISSN:0362-1340
            EISSN:1558-1160
            DOI:10.1145/1809028
            Issue’s Table of Contents

          Copyright © 2010 ACM

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 5 June 2010

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article

          Acceptance Rates

          Overall Acceptance Rate406of2,067submissions,20%

        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!