Characterizing Transactional Memory Consistency Conditions Using Observational Refinement

Transactional memory (TM) facilitates the development of concurrent applications by letting a programmer designate certain code blocks as atomic. The common approach to stating TM correctness is through a consistency condition that restricts the possible TM executions. Unfortunately, existing consistency conditions fall short of formalizing the intuitive semantics of atomic blocks through which programmers use a TM. To close this gap, we formalize programmer expectations as observational refinement between TM implementations. This states that properties of a program using a concrete TM implementation can be established by analyzing its behavior with an abstract TM, serving as a specification of the concrete one. We show that a variant of Transactional Memory Specification (TMS), a TM consistency condition, is equivalent to observational refinement for a programming language where local variables are rolled back upon a transaction abort. We thereby establish that TMS is the weakest acceptable condition for this case. We then propose a new consistency condition, called Strong Transactional Memory Specification (STMS), and show that it is equivalent to observational refinement for a language where local variables are not rolled back upon aborts. Finally, we show that under certain natural assumptions on TM implementations, STMS is equivalent to a variant of a well-known condition of opacity. Our results suggest a new approach to evaluating TM consistency conditions and enable TM implementors and language designers to make better-informed decisions.

[1]  Hagit Attiya,et al.  Safety of Live Transactions in Transactional Memory: TMS is Necessary and Sufficient , 2014, DISC.

[2]  Hagit Attiya,et al.  A programming language perspective on transactional memory consistency , 2013, PODC '13.

[3]  D. M. Hutton,et al.  The Art of Multiprocessor Programming , 2008 .

[4]  Pawel T. Wojciechowski,et al.  Last-use opacity: a strong safety property for transactional memory with prerelease support , 2015, Distributed Computing.

[5]  Michel Raynal,et al.  Virtual world consistency: A condition for STM systems (with a versatile protocol with invisible read operations) , 2012, Theor. Comput. Sci..

[6]  Michael F. Spear,et al.  NOrec: streamlining STM by abolishing ownership records , 2010, PPoPP '10.

[7]  Maged M. Michael,et al.  Implementing and Exploiting Inevitability in Software Transactional Memory , 2008, 2008 37th International Conference on Parallel Processing.

[8]  Torvald Riegel,et al.  A Lazy Snapshot Algorithm with Eager Validation , 2006, DISC.

[9]  Petr Kuznetsov,et al.  Safety of Deferred Update in Transactional Memory , 2013, 2013 IEEE 33rd International Conference on Distributed Computing Systems.

[10]  Simon L. Peyton Jones,et al.  Composable memory transactions , 2005, CACM.

[11]  Adam Welc,et al.  Irrevocable transactions and their applications , 2008, SPAA '08.

[12]  Hongseok Yang,et al.  Liveness-Preserving Atomicity Abstraction , 2011, ICALP.

[13]  C. A. R. Hoare,et al.  Data Refinement Refined , 1986, ESOP.

[14]  Martín Abadi,et al.  Semantics of transactional memory and automatic mutual exclusion , 2011, TOPL.

[15]  Mark Plesko,et al.  Optimizing memory transactions , 2006, PLDI '06.

[16]  Bratin Saha,et al.  Open nesting in software transactional memory , 2007, PPOPP.

[17]  Antony L. Hosking,et al.  Nested transactional memory: Model and architecture sketches , 2006, Sci. Comput. Program..

[18]  Maurice Herlihy,et al.  Software transactional memory for dynamic-sized data structures , 2003, PODC '03.

[19]  Leslie Lamport,et al.  How to Make a Multiprocessor Computer That Correctly Executes Multiprocess Programs , 2016, IEEE Transactions on Computers.

[20]  Peter W. O'Hearn,et al.  Abstraction for concurrent objects , 2009, Theor. Comput. Sci..

[21]  Stephen N. Zilles A Programming Language Perspective , 1982, On Conceptual Modelling.

[22]  Virendra J. Marathe,et al.  Adaptive Software Transactional Memory , 2005, DISC.

[23]  C. A. R. Hoare,et al.  Prespecification in Data Refinement , 1987, Inf. Process. Lett..

[24]  Maurice Herlihy,et al.  Transactional Memory: Architectural Support For Lock-free Data Structures , 1993, Proceedings of the 20th Annual International Symposium on Computer Architecture.

[25]  Nir Shavit,et al.  Transactional Locking II , 2006, DISC.

[26]  Rachid Guerraoui,et al.  On the correctness of transactional memory , 2008, PPoPP.

[27]  Christos H. Papadimitriou,et al.  The serializability of concurrent database updates , 1979, JACM.

[28]  Annette Bieniusa,et al.  Proving Isolation Properties for Software Transactional Memory , 2011, ESOP.

[29]  Dan Grossman,et al.  High-level small-step operational semantics for transactions , 2008, POPL '08.

[30]  Maurice Herlihy,et al.  Linearizability: a correctness condition for concurrent objects , 1990, TOPL.

[31]  Rachid Guerraoui,et al.  Principles of Transactional Memory , 2010, Synthesis Lectures on Distributed Computing Theory.

[32]  Michael F. Spear,et al.  Privatization techniques for software transactional memory , 2007, PODC '07.

[33]  Mark Moir,et al.  Towards formally specifying and verifying transactional memory , 2009, Formal Aspects of Computing.