skip to main content
research-article

AutoMO: automatic inference of memory order parameters for C/C++11

Published:23 October 2015Publication History
Skip Abstract Section

Abstract

Many concurrent data structures are initially designed for the sequential consistency (SC) memory model. Developers often implement these data structures on real-world systems with weaker memory models by adding sufficient fences to ensure that their implementation on the weak memory model exhibits the same executions as the SC memory model. Recently, the C11 and C++11 standards have added a weak memory model to the C and C++ languages. Developing and debugging code for weak memory models can be extremely challenging. We present AutoMO, a framework to support porting data structures designed for the SC memory model to the C/C++11 memory model. AutoMO provides support across the porting process: (1) it automatically infers initial settings for the memory order parameters, (2) it detects whether a C/C++11 execution is equivalent to some SC execution, and (3) it simplifies traces to make them easier to understand. We have used AutoMO to successfully infer memory order parameters for a range of data structures and to check whether executions of several concurrent data structure implementations are SC.

References

  1. ISO/IEC 9899:2011, Information technology – programming languages – C.Google ScholarGoogle Scholar
  2. ISO/IEC 14882:2011, Information technology – programming languages – C++.Google ScholarGoogle Scholar
  3. https://groups.google.com/forum/#!msg/comp. programming.threads/nSSFT9vKEe0/7eD3ioDg6nEJ. Oct. 2012.Google ScholarGoogle Scholar
  4. J. Alglave, L. Maranget, and M. Tautschnig. Herding cats: Modelling, simulation, testing, and data-mining for weak memory. In ACM Transactions on Programming Languages and Systems, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. M. Batty, S. Owens, S. Sarkar, P. Sewell, and T. Weber. Mathematizing C++ concurrency. In Proceedings of the Symposium on Principles of Programming Languages, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. M. Batty, M. Dodds, and A. Gotsman. Library abstraction for C/C++ concurrency. In Proceedings of the Symposium on Principles of Programming Languages, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. J. C. Blanchette, T. Weber, M. Batty, S. Owens, and S. Sarkar. Nitpicking C++ concurrency. In Proceedings of the 13th International ACM SIGPLAN Symposium on Principles and Practices of Declarative Programming, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. H. Boehm. Can seqlocks get along with programming language memory models? In Proceedings of the 2012 ACM SIGPLAN Workshop on Memory Systems Performance and Correctness, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. H. J. Boehm and S. V. Adve. Foundations of the C++ concurrency memory model. In Proceedings of the 2008 ACM SIGPLAN Conference on Programming Language Design and Implementation, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. S. Burckhardt and M. Musuvathi. Effective program verification for relaxed memory models. In Proceedings of the 20th International Conference on Computer Aided Verification, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. S. Burckhardt, R. Alur, and M. M. K. Martin. Checkfence: Checking consistency of concurrent data types on relaxed memory models. In Proceedings of the 2007 ACM SIGPLAN Conference on Programming Language Design and Implementation, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. M. Burke and R. Cytron. Interprocedural dependence analysis and parallelization. In Proceedings of the 1986 SIGPLAN Symposium on Compiler Construction, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. J. Burnim, K. Sen, and C. Stergiou. Sound and complete monitoring of sequential consistency for relaxed memory models. In Proceedings of the 17th International Conference on Tools and Algorithms for the Construction and Analysis of Systems, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. J. F. Cantin, M. H. Lipasti, and J. E. Smith. The complexity of verifying memory coherence and consistency. IEEE Transactions on Parallel and Distributed Systems, 16(7):663–671, July 2005. ISSN 1045-9219. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. M. K. Chen and K. Olukotun. The Jrpm system for dynamically parallelizing Java programs. In Proceedings of the 30th Annual International Symposium on Computer Architecture, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. T. Elmas, S. Qadeer, and S. Tasiran. Goldilocks: A race and transaction-aware Java runtime. In Proceedings of the 2007 ACM SIGPLAN Conference on Programming Language Design and Implementation, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. D. Engler and K. Ashcraft. RacerX: Effective, static detection of race conditions and deadlocks. In Proceedings of the Nineteenth ACM Symposium on Operating Systems Principles, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. C. Flanagan and S. N. Freund. FastTrack: Efficient and precise dynamic race detection. In Proceedings of the 2009 ACM SIGPLAN Conference on Programming Language Design and Implementation, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. K. Gharachorloo and P. B. Gibbons. Detecting violations of sequential consistency. In Proceedings of the Third Annual ACM Symposium on Parallel Algorithms and Architectures, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. P. B. Gibbons and E. Korach. The complexity of sequential consistency. In Proceedings of the 1992 IEEE International Symposium on Parallel & Distributed Processing, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. P. B. Gibbons and E. Korach. Testing shared memories. SIAM Journal on Computing, 26(4), August 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. G. Gopalakrishnan, Y. Yang, and H. Sivaraj. QB or not QB: An efficient execution verification tool for memory orderings. In Proceedings of the 16th International Conference on Computer Aided Verification, pages 401–413, 2004.Google ScholarGoogle ScholarCross RefCross Ref
  23. D. Hendler, N. Shavit, and L. Yerushalmi. A scalable lock-free stack algorithm. In Proceedings of the Sixteenth Annual ACM Symposium on Parallel Algorithms and Architectures, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. N. M. Lê, A. Pop, A. Cohen, and F. Zappa Nardelli. Correct and efficient work-stealing for weak memory models. In Proceedings of the 18th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. D. Lea. util.concurrent.ConcurrentHashMap in java.util.concurrent the Java Concurrency Package. http://docs.oracle.com/javase/8/docs/api/java/ util/concurrent/ConcurrentHashMap.html,.Google ScholarGoogle Scholar
  26. A. W. Lim and M. S. Lam. Maximizing parallelism and minimizing synchronization with affine transforms. In Proceedings of the Symposium on Principles of Programming Languages, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. F. Liu, N. Nedev, N. Prisadnikov, M. Vechev, and E. Yahav. Dynamic synthesis for relaxed memory models. In Proceedings of the 2012 ACM SIGPLAN Conference on Programming Language Design and Implementation, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. B. Lucia, L. Ceze, K. Strauss, S. Qadeer, and H. Boehm. Conflict exceptions: Simplifying concurrent language semantics with precise hardware exceptions for data-races. In Proceedings of the 37th Annual International Symposium on Computer Architecture, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. F. Mattern. Virtual time and global states of distributed systems. In Workshop on Parallel and Distributed Algorithms, 1989.Google ScholarGoogle Scholar
  30. A. Meixner and D. J. Sorin. Dynamic verification of sequential consistency. In Proceedings of the 32th Annual International Symposium on Computer Architecture, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. J. M. Mellor-Crummey and M. L. Scott. Algorithms for scalable synchronization on shared-memory multiprocessors. ACM Transactions on Computing Systems, 9(1), February 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. M. M. Michael. High performance dynamic lock-free hash tables and list-based sets. In Proceedings of the Fourteenth Annual ACM Symposium on Parallel Algorithms and Architectures, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. M. M. Michael and M. L. Scott. Simple, fast, and practical non-blocking and blocking concurrent queue algorithms. In Proceedings of the Fifteenth Annual ACM Symposium on Principles of Distributed Computing, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. A. Muzahid, S. Qi, and J. Torrellas. Vulcan: Hardware support for detecting sequential consistency violations dynamically. In 45rd Annual IEEE/ACM International Symposium on Microarchitecture, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. B. Norris and B. Demsky. CDSChecker: Checking concurrent data structures written with C/C++ atomics. In Proceeding of the 28th ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. S. Owens. Reasoning about the implementation of concurrency abstractions on x86-tso. In Proceedings of the 24th European Conference on Object-Oriented Programming, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. X. Qian, J. Torrellas, B. Sahelices, and D. Qian. Volition: Scalable and precise sequential consistency violation detection. In 18th International Conference on Architectural Support for Programming Languages and Operating Systems, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. A. Roy, S. Zeisset, C. J. Fleckenstein, and J. C. Huang. Fast and generalized polynomial time memory consistency verification. In Proceedings of the 18th International Conference on Computer Aided Verification, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. S. Rus, M. Pennings, and L. Rauchwerger. Sensitivity analysis for automatic parallelization on multi-cores. In Proceedings of the International Conference on Supercomputing, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. S. Savage, M. Burrows, G. Nelson, P. Sobalvarro, and T. Anderson. Eraser: A dynamic data race detector for multithreaded programs. ACM Transactions on Computing Systems, 15:391– 411, Nov. 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. E. Torlak, M. Vaziri, and J. Dolby. Memsat: Checking axiomatic specifications of memory models. In Proceedings of the 2010 ACM SIGPLAN Conference on Programming Language Design and Implementation, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. R. K. Treiber. Systems programming: Coping with parallelism. Technical Report RJ 5118, IBM Almaden Research Center, April 1986.Google ScholarGoogle Scholar
  43. J. D. Valois. Lock-free linked lists using compare-and-swap. In Proceedings of the Fourteenth Annual ACM Symposium on Principles of Distributed Computing, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. AutoMO: automatic inference of memory order parameters for C/C++11

                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

                Full Access

                • Published in

                  cover image ACM SIGPLAN Notices
                  ACM SIGPLAN Notices  Volume 50, Issue 10
                  OOPSLA '15
                  October 2015
                  953 pages
                  ISSN:0362-1340
                  EISSN:1558-1160
                  DOI:10.1145/2858965
                  • Editor:
                  • Andy Gill
                  Issue’s Table of Contents
                  • cover image ACM Conferences
                    OOPSLA 2015: Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications
                    October 2015
                    953 pages
                    ISBN:9781450336895
                    DOI:10.1145/2814270

                  Copyright © 2015 ACM

                  Publisher

                  Association for Computing Machinery

                  New York, NY, United States

                  Publication History

                  • Published: 23 October 2015

                  Check for updates

                  Qualifiers

                  • research-article

                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!