A Domain Specific Language for Composable Memory Transactions in Java

  • Authors:
  • André Rauber Bois;Marcos Echevarria

  • Affiliations:
  • PPGInf - Programa de Pós-Graduação em Informática, Universidade Católica de Pelotas, Pelotas-RS, Brazil CEP: 96010-000;PPGInf - Programa de Pós-Graduação em Informática, Universidade Católica de Pelotas, Pelotas-RS, Brazil CEP: 96010-000

  • Venue:
  • DSL '09 Proceedings of the IFIP TC 2 Working Conference on Domain-Specific Languages
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

Abstract

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.