A Domain Specific Language for Composable Memory Transactions in Java

In this paper we present CMTJava, a domain specific language for composable memory transactions [7] in Java. CMTJava provides the abstraction of transactional objects . Transactional objects have their fields accessed only by special get and set methods that are automatically generated by the compiler. These methods return transactional actions as a result. A transactional action is an action that, when executed, will produce the desired effect. Transactional actions can only be executed by the atomic method. Transactional actions are first class values in Java and they are composable: transactions can be combined to generate new transactions. The Java type system guarantees that the fields of transactional objects will never be accessed outside a transaction. CMTJava supports the retry and orElse constructs from STM Haskell. To validate our design we implemented a simple transactional system following the description of the original Haskell system. CMTJava is implemented as a state passing monad using BBGA closures, a Java extension that supports closures in Java.

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

[2]  Kunle Olukotun,et al.  Characterization of TCC on chip-multiprocessors , 2005, 14th International Conference on Parallel Architectures and Compilation Techniques (PACT'05).

[3]  Kunle Olukotun,et al.  The Atomos transactional programming language , 2006, PLDI '06.

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

[5]  Peyton Jones,et al.  Haskell 98 language and libraries : the revised report , 2003 .

[6]  Frank Huch,et al.  A High-Level Implementation of Composable Memory Transactions in Concurrent Haskell , 2005, IFL.

[7]  Keir Fraser,et al.  Language support for lightweight transactions , 2003, SIGP.

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

[9]  Simon Peyton Jones,et al.  Tackling the Awkward Squad: monadic input/output, concurrency, exceptions, and foreign-language calls in Haskell , 2005 .

[10]  Kunle Olukotun,et al.  Transactional memory coherence and consistency , 2004, Proceedings. 31st Annual International Symposium on Computer Architecture, 2004..

[11]  James R. Larus,et al.  Transactional Memory , 2006, Transactional Memory.

[12]  Maurice Herlihy,et al.  Virtualizing transactional memory , 2005, 32nd International Symposium on Computer Architecture (ISCA'05).

[13]  Paul Hudak,et al.  Lambda in Motion: Controlling Robots with Haskell , 1999, PADL.

[14]  Håkan Grahn,et al.  Transactional memory , 2010, J. Parallel Distributed Comput..

[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]  Nir Shavit,et al.  Software transactional memory , 1995, PODC '95.

[17]  R. Rajwar,et al.  Transactional Execution: Toward Reliable, High-Performance Multithreading , 2003, IEEE Micro.

[18]  Philip Wadler,et al.  Featherweight Java: a minimal core calculus for Java and GJ , 2001, TOPL.

[19]  Edward A. Lee The problem with threads , 2006, Computer.

[20]  Manfred Broy,et al.  Engineering Theories of Software Construction , 2001 .

[21]  Graham Hutton,et al.  Monadic parsing in Haskell , 1998, Journal of Functional Programming.

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

[23]  Maurice Herlihy,et al.  A flexible framework for implementing software transactional memory , 2006, OOPSLA '06.