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.
- ISO/IEC 9899:2011, Information technology – programming languages – C.Google Scholar
- ISO/IEC 14882:2011, Information technology – programming languages – C++.Google Scholar
- https://groups.google.com/forum/#!msg/comp. programming.threads/nSSFT9vKEe0/7eD3ioDg6nEJ. Oct. 2012.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- M. Burke and R. Cytron. Interprocedural dependence analysis and parallelization. In Proceedings of the 1986 SIGPLAN Symposium on Compiler Construction, 1986. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- P. B. Gibbons and E. Korach. Testing shared memories. SIAM Journal on Computing, 26(4), August 1997. Google Scholar
Digital Library
- 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 Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- F. Mattern. Virtual time and global states of distributed systems. In Workshop on Parallel and Distributed Algorithms, 1989.Google Scholar
- A. Meixner and D. J. Sorin. Dynamic verification of sequential consistency. In Proceedings of the 32th Annual International Symposium on Computer Architecture, 2005. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- R. K. Treiber. Systems programming: Coping with parallelism. Technical Report RJ 5118, IBM Almaden Research Center, April 1986.Google Scholar
- 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 Scholar
Digital Library
Index Terms
AutoMO: automatic inference of memory order parameters for C/C++11
Recommendations
AutoMO: automatic inference of memory order parameters for C/C++11
OOPSLA 2015: Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and ApplicationsMany 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 ...
Repairing sequential consistency in C/C++11
PLDI '17The C/C++11 memory model defines the semantics of concurrent memory accesses in C/C++, and in particular supports racy "atomic" accesses at a range of different consistency levels, from very weak consistency ("relaxed") to strong, sequential ...
Causal memory: definitions, implementation, and programming
The abstraction of a shared memory is of growing importance in distributed computing systems. Traditional memory consistency ensures that all processes agree on a common order of all operations on memory. Unfortunately, providing these guarantees ...






Comments