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.
Chapter PDF
Similar content being viewed by others
Keywords
- Transactional Action
- Transactional Memory
- Translation Rule
- Software Transactional Memory
- Memory Transaction
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
All About Monads. WWW page (December 2008), http://www.haskell.org/all_about_monads/html/index.html
Java Closures. WWW page (December 2008), http://www.javac.info/
JSR Proposal: Closures for Java. WWW page (December 2008), http://www.javac.info/consensus-closures-jsr.html
Carlstrom, B.D., McDonald, A., Chafi, H., Chung, J., Minh, C.C., Kozyrakis, C., Olukotun, K.: The ATOMOS transactional programming language. ACM SIGPLAN Notices 41(6), 1–13 (2006)
Hammond, L., Wong, V., Chen, M., Carlstrom, B.D., Davis, J.D., Hertzberg, B., Prabhu, M.K., Wijaya, H., Kozyrakis, C., Olukotun, K.: Transactional memory coherence and consistency, New York, NY, USA, vol. 32, p. 102. ACM, New York (2004)
Harris, T., Fraser, K.: Language support for lightweight transactions. ACM SIGPLAN Notices 38(11), 388–402 (2003)
Harris, T., Marlow, S., Peyton Jones, S., Herlihy, M.: Composable memory transactions. In: PPoPP 2005. ACM Press, New York (2005)
Herlihy, M., Luchangco, V., Moir, M.: A flexible framework for implementing software transactional memory. SPNOTICES: ACM SIGPLAN Notices 41 (2006)
Herlihy, M., Luchangco, V., Moir, M., Scherer III, W.N.: Software transactional memory for dynamic-sized data structures. In: PODC: 22th ACM SIGACT-SIGOPS Symposium on Principles of Distributed Computing (2003)
Herlihy, M., Moss, J.E.B.: Transactional memory: Architectural support for lock-free data structures. In: Proceedings of the Twentieth Annual International Symposium on Computer Architecture (1993)
Hoare, C.A.R.: Towards a theory of parallel programming. Operating System Techniques, 61–71 (1972)
Huch, F., Kupke, F.: A high-level implementation of composable memory transactions in concurrent haskell. In: Butterfield, A., Grelck, C., Huch, F. (eds.) IFL 2005. LNCS, vol. 4015, pp. 124–141. Springer, Heidelberg (2006)
Hutton, G., Meijer, E.: Monadic Parsing in Haskell. Journal of Functional Programming 8(4), 437–444 (1998)
Igarashi, A., Pierce, B., Wadler, P.: Featherweight Java: A minimal core calculus for Java and GJ. TOPLAS 23(3), 396–459 (2001)
Larus, J., Rajwar, R.: Transactional Memory. Morgan & Claypool (2006)
Lee, E.A.: The problem with threads. IEEE Computer 39(5), 33–42 (2006)
Marathe, V.J., Spear, M.F., Heriot, C., Acharya, A., Eisenstat, D., Scherer III, W.N., Scott, M.L.: Lowering the overhead of nonblocking software transactional memory. revised, University of Rochester, Computer Science Department (May 2006)
McDonald, A., Chung, J., Chafi, H., Minh, C.C., Carlstrom, B.D., Hammond, L., Kozyrakis, C., Olukotun, K.: Characterization of TCC on chip-multiprocessors. In: Proc. 14th International Conference on Parallel Architecture and Compilation Techniques (14th PACT 2005), pp. 63–74. IEEE Computer Society, Los Alamitos (2005)
Peterson, J., Hudak, P., Elliott, C.: Lambda in motion: Controlling robots with haskell. In: Gupta, G. (ed.) PADL 1999. LNCS, vol. 1551, pp. 91–105. Springer, Heidelberg (1999)
Peyton Jones, S.: Tackling the awkward squad: monadic input/output, concurrency, exceptions, and foreign-language calls in Haskell. In: Engineering theories of software construction, pp. 47–96. IOS Press, Amsterdam (2001)
Peyton Jones, S.: Haskell 98 language and libraries: the revised report. Journal of Functional Programming 1(13) (2003)
Peyton Jones, S.: Beautiful Concurrency. O’Reilly, Sebastopol (2007)
Rajwar, R., Herlihy, M., Lai, K.K.: Virtualizing transactional memory. In: ISCA, pp. 494–505. IEEE Computer Society, Los Alamitos (2005)
Rajwar, R., James, G.: Transactional execution: Toward reliable, high-performance multithreading. IEEE Micro. 23(6), 117–125 (2003)
Shavit, N., Touitou, D.: Software transactional memory. DISTCOMP: Distributed Computing, 10 (1997)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2009 IFIP International Federation for Information Processing
About this paper
Cite this paper
Du Bois, A.R., Echevarria, M. (2009). A Domain Specific Language for Composable Memory Transactions in Java. In: Taha, W.M. (eds) Domain-Specific Languages. DSL 2009. Lecture Notes in Computer Science, vol 5658. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-03034-5_9
Download citation
DOI: https://doi.org/10.1007/978-3-642-03034-5_9
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-03033-8
Online ISBN: 978-3-642-03034-5
eBook Packages: Computer ScienceComputer Science (R0)