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

Dynamic synthesis for relaxed memory models

Published:11 June 2012Publication History

ABSTRACT

Modern architectures implement relaxed memory models which may reorder memory operations or execute them non-atomically. Special instructions called memory fences are provided, allowing control of this behavior.

To implement a concurrent algorithm for a modern architecture, the programmer is forced to manually reason about subtle relaxed behaviors and figure out ways to control these behaviors by adding fences to the program. Not only is this process time consuming and error-prone, but it has to be repeated every time the implementation is ported to a different architecture.

In this paper, we present the first scalable framework for handling real-world concurrent algorithms running on relaxed architectures. Given a concurrent C program, a safety specification, and a description of the memory model, our framework tests the program on the memory model to expose violations of the specification, and synthesizes a set of necessary ordering constraints that prevent these violations. The ordering constraints are then realized as additional fences in the program.

We implemented our approach in a tool called DFence based on LLVM and used it to infer fences in a number of concurrent algorithms. Using DFence, we perform the first in-depth study of the interaction between fences in real-world concurrent C programs, correctness criteria such as sequential consistency and linearizability, and memory models such as TSO and PSO, yielding many interesting observations. We believe that this is the first tool that can handle programs at the scale and complexity of a lock-free memory allocator.

References

  1. Personal Communication with the Cilk Team, 2011.Google ScholarGoogle Scholar
  2. Adve, S. V., and Gharachorloo, K. Shared memory consistency models: A tutorial. IEEE Computer 29 (1995), 66--76. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Attiya, H., Guerraoui, R., Hendler, D., Kuznetsov, P., Michael, M. M., and Vechev, M. Laws of order: expensive synchronization in concurrent algorithms cannot be eliminated. In POPL'11 (New York, NY, USA), ACM, pp. 487--498. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Burckhardt, S., Alur, R., and Martin, M. M. K. CheckFence: checking consistency of concurrent data types on relaxed memory models. In PLDI (2007), pp. 12--21. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Burckhardt, S., and Musuvathi, M. Effective program verification for relaxed memory models. In CAV (2008), pp. 107--120. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Burnim, J., Sen, K., and Stergiou, C. Testing concurrent programs on relaxed memory models. In ISSTA (2011), pp. 122--132. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Chase, D., and Lev, Y. Dynamic circular work-stealing deque. In SPAA (2005), pp. 21--28. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Detlefs, D. L., Flood, C. H., Garthwaite, A. T., Garthwaite, E. T., Martin, P. A., Shavit, N. N., Jr., and Steele, G. L. Even better dcas-based concurrent deques. In DISC'00. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Dice, D., Lev, Y., Marathe, V. J., Moir, M., Nussbaum, D., and Oleszewski, M. Simplifying concurrent algorithms by exploiting hardware transactional memory. In SPAA'10, ACM, pp. 325--334. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Eén, N., and Sörensson, N. An extensible sat-solver. In SAT (2003), pp. 502--518.Google ScholarGoogle Scholar
  11. Fang, X., Lee, J., and Midkiff, S. P. Automatic fence insertion for shared memory multiprocessing. In ICS (2003), pp. 285--294. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Frigo, M., Leiserson, C. E., and Randall, K. H. The implementation of the cilk-5 multithreaded language. In PLDI '98. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Heller, S., Herlihy, M., Luchangco, V., Moir, M., Scherer, W., and Shavit, N. A lazy concurrent list-based set algorithm. In OPODIS '05, pp. 3--16. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Herlihy, M., and Shavit, N. The Art of Multiprocessor Programming. Morgan Kaufmann, Apr. 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Huynh, T. Q., and Roychoudhury, A. Memory model sensitive bytecode verification. Form. Methods Syst. Des. 31, 3 (2007). Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Jonsson, B. State-space exploration for concurrent algorithms under weak memory orderings. SIGARCH Comput. Archit. News 36, 5 (2008), 65--71. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Kuperstein, M., Vechev, M., and Yahav, E. Automatic inference of memory fences. In FMCAD'10. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Kuperstein, M., Vechev, M., and Yahav, E. Partial-coherence abstractions for relaxed memory models. In PLDI'11, pp. 187--198. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Lattner, C., and Adve, V. LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation. In CGO'04, pp. 75--87. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Lee, J., and Padua, D. A. Hiding relaxed memory consistency with a compiler. IEEE Trans. Comput. 50, 8 (2001), 824--833. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Michael, M. M. Scalable lock-free dynamic memory allocation. In PLDI '04 (2004), pp. 35--46. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Michael, M. M., and Scott, M. L. Correction of a memory management method for lock-free data structures. Tech. rep., 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Michael, M. M., and Scott, M. L. Simple, fast, and practical non-blocking and blocking concurrent queue algorithms. In PODC (1996), pp. 267--275. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Michael, M. M., Vechev, M. T., and Saraswat, V. A. Idempotent work stealing. In PPoPP (2009), pp. 45--54. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Park, S., and Dill, D. L. An executable specification and verifier for relaxed memory order. IEEE Trans. on Computers 48 (1999). Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Shasha, D., and Snir, M. Efficient and correct execution of parallel programs that share memory. ACM Trans. Program. Lang. Syst. 10, 2 (1988), 282--312. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Sura, Z., Wong, C., Fang, X., Lee, J., Midkiff, S., and Padua, D. Automatic implementation of programming language consistency models. LNCS 2481 (2005), 172. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Sutter, H., and Larus, J. Software and the concurrency revolution. Queue 3, 7 (2005), 54--62. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Vechev, M., Yahav, E., and Yorsh, G. Experience with model checking linearizability. In SPIN'09, pp. 261--278. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Vechev, M., Yahav, E., and Yorsh, G. Abstraction-guided synthesis of synchronization. In POPL (2010). Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Weeratunge, D., Zhang, X., and Jaganathan, S. Accentuating the positive: atomicity inference and enforcement using correct executions. In OOPSLA'11, pp. 19--34. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Dynamic synthesis for relaxed memory models

                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 '12: Proceedings of the 33rd ACM SIGPLAN Conference on Programming Language Design and Implementation
                  June 2012
                  572 pages
                  ISBN:9781450312059
                  DOI:10.1145/2254064
                  • cover image ACM SIGPLAN Notices
                    ACM SIGPLAN Notices  Volume 47, Issue 6
                    PLDI '12
                    June 2012
                    534 pages
                    ISSN:0362-1340
                    EISSN:1558-1160
                    DOI:10.1145/2345156
                    Issue’s Table of Contents

                  Copyright © 2012 ACM

                  Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                  Publisher

                  Association for Computing Machinery

                  New York, NY, United States

                  Publication History

                  • Published: 11 June 2012

                  Permissions

                  Request permissions about this article.

                  Request Permissions

                  Check for updates

                  Qualifiers

                  • research-article

                  Acceptance Rates

                  PLDI '12 Paper Acceptance Rate48of255submissions,19%Overall Acceptance Rate406of2,067submissions,20%

                  Upcoming Conference

                  PLDI '24

                PDF Format

                View or Download as a PDF file.

                PDF

                eReader

                View online with eReader.

                eReader