Counter-Example Guided Fence Insertion under TSO

We give a sound and complete fence insertion procedure for concurrent finite-state programs running under the classical TSO memory model. This model allows "write to read" relaxation corresponding to the addition of an unbounded store buffer between each processor and the main memory. We introduce a novel machine model, called the Single-Buffer (SB) semantics, and show that the reachability problem for a program under TSO can be reduced to the reachability problem under SB. We present a simple and effective backward reachability analysis algorithm for the latter, and propose a counter-example guided fence insertion procedure. The procedure is augmented by a placement constraint that allows the user to choose places inside the program where fences may be inserted. For a given placement constraint, we automatically infer all minimal sets of fences that ensure correctness. We have implemented a prototype and run it successfully on all standard benchmarks together with several challenging examples that are beyond the applicability of existing methods.

[1]  Eran Yahav,et al.  Automatic inference of memory fences , 2010, Formal Methods in Computer Aided Design.

[2]  Jaejin Lee,et al.  Automatic fence insertion for shared memory multiprocessing , 2003, ICS '03.

[3]  Debra Hensgen,et al.  Two algorithms for barrier synchronization , 1988, International Journal of Parallel Programming.

[4]  Edsger W. Dijkstra,et al.  Cooperating sequential processes , 2002 .

[5]  Koushik Sen,et al.  Testing concurrent programs on relaxed memory models , 2011, ISSTA '11.

[6]  Rajeev Alur,et al.  A Temporal Logic of Nested Calls and Returns , 2004, TACAS.

[7]  Aaas News,et al.  Book Reviews , 1893, Buffalo Medical and Surgical Journal.

[8]  David Aspinall,et al.  Formalising Java's Data Race Free Guarantee , 2007, TPHOLs.

[9]  Leslie Lamport,et al.  A fast mutual exclusion algorithm , 1987, TOCS.

[10]  Mohamed Faouzi Atig,et al.  Getting Rid of Store-Buffers in TSO Analysis , 2011, CAV.

[11]  Scott Owens,et al.  Reasoning about the Implementation of Concurrency Abstractions on x86-TSO , 2010, ECOOP.

[12]  Sebastian Burckhardt,et al.  Effective Program Verification for Relaxed Memory Models , 2008, CAV.

[13]  Sarita V. Adve,et al.  Shared Memory Consistency Models: A Tutorial , 1996, Computer.

[14]  Thuan Quang Huynh,et al.  A Memory Model Sensitive Checker for C# , 2006, FM.

[15]  Sebastian Burckhardt,et al.  On the verification problem for weak memory models , 2010, POPL '10.

[16]  Theo D'Hondt ECOOP 2010 - Object-Oriented Programming, 24th European Conference, Maribor, Slovenia, June 21-25, 2010. Proceedings , 2010, ECOOP.

[17]  Tobias Nipkow,et al.  FM 2006: Formal Methods, 14th International Symposium on Formal Methods, Hamilton, Canada, August 21-27, 2006, Proceedings , 2006, FM.

[18]  Peter Sewell,et al.  A Better x86 Memory Model: x86-TSO (Extended Version) , 2009 .

[19]  Pierre Wolper,et al.  An Automata-Based Symbolic Approach for Verifying Programs on Relaxed Memory Models , 2010, SPIN.

[20]  Sebastian Burckhardt,et al.  CheckFence: checking consistency of concurrent data types on relaxed memory models , 2007, PLDI '07.

[21]  Keir Fraser,et al.  Practical lock-freedom , 2003 .

[22]  Parosh Aziz Abdulla,et al.  General decidability theorems for infinite-state systems , 1996, Proceedings 11th Annual IEEE Symposium on Logic in Computer Science.

[23]  Jade Alglave,et al.  Stability in Weak Memory Models , 2011, CAV.

[24]  Simon Maskell,et al.  Fast mutual exclusion , 2004, SPIE Defense + Commercial Sensing.

[25]  Koushik Sen,et al.  Sound and Complete Monitoring of Sequential Consistency for Relaxed Memory Models , 2011, TACAS.

[26]  Gary L. Peterson,et al.  Myths About the Mutual Exclusion Problem , 1981, Inf. Process. Lett..

[27]  Erik Hagersten,et al.  Queue locks on cache coherent multiprocessors , 1994, Proceedings of 8th International Parallel Processing Symposium.

[28]  Sebastian Burckhardt,et al.  Bounded Model Checking of Concurrent Data Types on Relaxed Memory Models: A Case Study , 2006, CAV.

[29]  Leslie Lamport,et al.  The mutual exclusion problem: partII—statement and solutions , 1986, JACM.

[30]  N. Lynch,et al.  DISTRIBUTED ALGORITHMS , Lecture Notes for 6.852 FALL 1992 , 1993 .

[31]  Michael L. Scott,et al.  Algorithms for scalable synchronization on shared-memory multiprocessors , 1991, TOCS.

[32]  David L Weaver,et al.  The SPARC architecture manual : version 9 , 1994 .

[33]  Pierre Wolper,et al.  A Verification-Based Approach to Memory Fence Insertion in Relaxed Memory Systems , 2011, SPIN.

[34]  G. S. Graham A New Solution of Dijkstra ' s Concurrent Programming Problem , 2022 .

[35]  Eran Yahav,et al.  Partial-coherence abstractions for relaxed memory models , 2011, PLDI '11.

[36]  Nancy A. Lynch,et al.  Distributed Algorithms , 1992, Lecture Notes in Computer Science.

[37]  Peter Sewell,et al.  A Better x86 Memory Model: x86-TSO , 2009, TPHOLs.

[38]  Graham Higman,et al.  Ordering by Divisibility in Abstract Algebras , 1952 .