On the Correctness of Transactional Memory

Transactional memory (TM) is perceived as an appealing alternative to critical sections for general purpose concurrent programming. Despite the large amount of recent work on TM implementations, however, very little effort has been devoted to precisely defining what guarantees these implementations should provide. A formal description of such guarantees is necessary in order to check the correctness of TM systems, as well as to establish TM optimality results and inherent trade-offs. This paper presents opacity, a candidate correctness criterion for TM implementations. We define opacity as a property of concurrent transaction histories and give its graph theoretical interpretation. Opacity captures precisely the correctness requirements that have been intuitively described by many TM designers. Most TM systems we know of do ensure opacity. At a very first approximation, opacity can be viewed as an extension of the classical database serializability property with the additional requirement that even non-committed transactions are prevented from accessing inconsistent states. Capturing this requirement precisely, in the context of general objects, and without precluding pragmatic strategies that are often used by modern TM implementations, such as versioning, invisible reads, lazy updates, and open nesting, is not trivial. As a use case of opacity, we prove the first lower bound on the complexity of TM implementations. Basically, we show that every single-version TM system that uses invisible reads and does not abort non-conflicting transactions requires, in the worst case, ( k) steps for an operation to terminate, where k is the total number of objects shared by transactions. This (tight) bound precisely captures an inherent trade-off in the design of TM systems. The bound also highlights a fundamental gap between systems in which transactions can be fully isolated from the outside environment, e.g., databases or certain specialized transactional languages, and systems that lack such isolation capabilities, e.g., general TM frameworks.

[1]  Michael F. Spear,et al.  Conflict Detection and Validation Strategies for Software Transactional Memory , 2006, DISC.

[2]  J. Eliot B. Moss Open Nested Transactions: Semantics and Support , 2006 .

[3]  Michael L. Scott Sequential Specification of Transactional Memory Semantics , 2006 .

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

[5]  Philip A. Bernstein,et al.  Categories and Subject Descriptors: H.2.4 [Database Management]: Systems. , 2022 .

[6]  Vassos Hadzilacos,et al.  A theory of reliability in database systems , 1988, JACM.

[7]  João P. Cachopo,et al.  Versioned boxes as the basis for memory transactions , 2006, Sci. Comput. Program..

[8]  Rachid Guerraoui,et al.  Toward a theory of transactional contention managers , 2005, PODC '05.

[9]  Milo M. K. Martin,et al.  Subtleties of transactional memory atomicity semantics , 2006, IEEE Computer Architecture Letters.

[10]  E. B. Moss,et al.  Nested Transactions: An Approach to Reliable Distributed Computing , 1985 .

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

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

[13]  Eliot B. Moss,et al.  Nested Transactions and Reliable Distributed Computing , 1982 .

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

[15]  David Eisenstat,et al.  Lowering the Overhead of Software Transactional Memory , 2006 .

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

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

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

[19]  William E. Weihl,et al.  Local atomicity properties: modular concurrency control for abstract data types , 1989, TOPL.

[20]  Abraham Silberschatz,et al.  On Rigorous Transaction Scheduling , 1991, IEEE Trans. Software Eng..

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

[22]  Nir Shavit,et al.  Software transactional memory , 1995, PODC '95.

[23]  Torvald Riegel,et al.  Snapshot Isolation for Software Transactional Memory , 2006 .

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

[25]  Robert Ennals Software Transactional Memory Should Not Be Obstruction-Free , 2005 .

[26]  Rachid Guerraoui,et al.  Opacity: A Correctness Condition for Transactional Memory , 2007 .

[27]  Jim Gray,et al.  A critique of ANSI SQL isolation levels , 1995, SIGMOD '95.