Language support for lightweight transactions

Concurrent programming is notoriously difficult. Current abstractions are intricate and make it hard to design computer systems that are reliable and scalable. We argue that these problems can be addressed by moving to a declarative style of concurrency control in which programmers directly indicate the safety properties that they require. In our scheme the programmer demarks sections of code which execute within lightweight software-based transactions that commit atomically and exactly once. These transactions can update shared data, instantiate objects, invoke library features and so on. They can also block, waiting for arbitrary boolean conditions to become true. Transactions which do not access the same shared memory locations can commit concurrently. Furthermore, in general, no performance penalty is incurred for memory accesses outside transactions.We present a detailed design of this proposal along with an implementation and evaluation. We argue that the resulting system (i) is easier for mainstream programmers to use, (ii) prevents lock-based priority-inversion and deadlock problems and (iii) can offer performance advantages.

[1]  Per Brinch Hansen,et al.  Distributed processes: a concurrent programming concept , 1978, CACM.

[2]  James H. Anderson,et al.  Proceedings of the twelfth annual ACM symposium on Principles of distributed computing , 1993, PODC 1993.

[3]  David B. Lomet,et al.  Process structuring, synchronization, and recovery using atomic actions , 1977, Language Design for Reliable Software.

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

[5]  Tim Harris Design choices for language-based transactions , 2003 .

[6]  Cormac Flanagan,et al.  Types for atomicity , 2003, TLDI '03.

[7]  William Pugh,et al.  Semantics of Multithreaded Java , 2001 .

[8]  Luca Cardelli,et al.  Modern concurrency abstractions for C# , 2002, TOPL.

[9]  Jean Bacon,et al.  Operating Systems - Concurrent and Distributed Software Design , 2003, International computer science series.

[10]  Michael L. Scott,et al.  Language Support for Loosely Coupled Distributed Programs , 1987, IEEE Transactions on Software Engineering.

[11]  Maged M. Michael,et al.  Correction of a Memory Management Method for Lock-Free Data Structures , 1995 .

[12]  Frank Yellin,et al.  The Java Virtual Machine Specification , 1996 .

[13]  David S. Platt,et al.  Introducing Microsoft® .NET , 2001 .

[14]  Y. S. Ramakrishna,et al.  An efficient meta-lock for implementing ubiquitous synchronization , 1999, OOPSLA '99.

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

[16]  Barbara Liskov,et al.  Guardians and actions: linguistic support for robust, distributed programs , 1982, POPL '82.

[17]  Mark Moir,et al.  Transparent Support for Wait-Free Transactions , 1997, WDAG.

[18]  Gregory R. Andrews,et al.  Concurrent programming - principles and practice , 1991 .

[19]  Hans Albrecht Schmid On the efficient implementation of conditional critical regions and the construction of monitors , 2004, Acta Informatica.

[20]  Maged M. Michael Safe memory reclamation for dynamic lock-free objects using atomic reads and writes , 2002, PODC '02.

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

[22]  Keir Fraser,et al.  A Practical Multi-word Compare-and-Swap Operation , 2002, DISC.

[23]  Per Brinch Hansen Edison—a multiprocessor language , 1981, Softw. Pract. Exp..

[24]  Luca Cardelli,et al.  Mobile Ambients , 1998, FoSSaCS.

[25]  Maurice Herlihy,et al.  The Repeat Offender Problem: A Mechanism for Supporting Dynamic-Sized, Lock-Free Data Structures , 2002, DISC.

[26]  Sheng Liang,et al.  Dynamic class loading in the Java virtual machine , 1998, OOPSLA '98.

[27]  References , 1971 .

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

[29]  C. A. R. Hoare,et al.  Communicating sequential processes , 1978, CACM.

[30]  David A. Patterson,et al.  Computer Architecture: A Quantitative Approach , 1969 .

[31]  Maurice Herlihy,et al.  Obstruction-free synchronization: double-ended queues as an example , 2003, 23rd International Conference on Distributed Computing Systems, 2003. Proceedings..

[32]  Charles Antony Richard Hoare Towards a theory of parallel programming , 2002 .

[33]  Robin Milner The Pi calculus and its applications , 1997, ICLP 1998.