Skip to main content
Top

2015 | OriginalPaper | Chapter

Composable Memory Transactions for Java Using a Monadic Intermediate Language

Authors : Rafael Bandeira, André R. Du Bois, Maurício Pilla, Juliana Vizzotto, Marcelo Machado

Published in: Programming Languages

Publisher: Springer International Publishing

Activate our intelligent search to find suitable subject content or patents.

search-config
loading …

Abstract

Transactional memory is a new programming abstraction that simplifies concurrent programming. This paper describes the parallel implementation of a Java extension for writing composable memory transactions in Java. Transactions are composable i.e., they can be combined to generate new transactions, and are first-class values, i.e., transactions can be passed as arguments to methods and can be returned as the result of a method call. We describe how composable memory transactions can be implemented in Java as a state passing monad, in which transactional blocks are compiled into an intermediate monadic language. We show that this intermediated language can support different transactional algorithms, such as TL2 [9] and SWissTM [10]. The implementation described here also provides the high level construct retry, which allows possibly-blocking transactions to be composed in sequence. Although our prototype implementation is in Java using BGGA Closures, it could be implemented in any language that supports objects and closures in some way, e.g. C#, C++, and Python.

Dont have a licence yet? Then find out more about our products and how to get one now:

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Literature
5.
go back to reference Bieniusa, A., Middelkoop, A., Thiermann, P.: Twilight in haskell: software transactional memory with safe I/O and typed conflict management. In: Preproceedings of IFL 2010, September 2010 Bieniusa, A., Middelkoop, A., Thiermann, P.: Twilight in haskell: software transactional memory with safe I/O and typed conflict management. In: Preproceedings of IFL 2010, September 2010
6.
go back to reference Du Bois, A.R., Echevarria, M.: A domain specific language for composable memory transactions in java. In: Taha, W.M. (ed.) DSL 2009. LNCS, vol. 5658, pp. 170–186. Springer, Heidelberg (2009) CrossRef Du Bois, A.R., Echevarria, M.: A domain specific language for composable memory transactions in java. In: Taha, W.M. (ed.) DSL 2009. LNCS, vol. 5658, pp. 170–186. Springer, Heidelberg (2009) CrossRef
7.
go back to reference Bronson, N.G., Chafi, H., Olukotun, K.: Ccstm: a library-based stm for scala. In: The First Annual Scala Workshop at Scala Days (2010) Bronson, N.G., Chafi, H., Olukotun, K.: Ccstm: a library-based stm for scala. In: The First Annual Scala Workshop at Scala Days (2010)
8.
go back to reference Carlstrom, B.D., McDonald, A., Chafi, H., Chung, J., Minh, C.C., Kozyrakis, C., Olukotun, K.: The ATOMOS transactional programming language. ACM SIGPLAN Not. 41(6), 1–13 (2006)CrossRefMATH Carlstrom, B.D., McDonald, A., Chafi, H., Chung, J., Minh, C.C., Kozyrakis, C., Olukotun, K.: The ATOMOS transactional programming language. ACM SIGPLAN Not. 41(6), 1–13 (2006)CrossRefMATH
9.
go back to reference Dice, D., Shalev, O., Shavit, N.N.: Transactional locking II. In: Dolev, S. (ed.) DISC 2006. LNCS, vol. 4167, pp. 194–208. Springer, Heidelberg (2006) CrossRef Dice, D., Shalev, O., Shavit, N.N.: Transactional locking II. In: Dolev, S. (ed.) DISC 2006. LNCS, vol. 4167, pp. 194–208. Springer, Heidelberg (2006) CrossRef
10.
go back to reference Dragojević, A., Guerraoui, R., Kapalka, M.: Stretching transactional memory. In: Proceedings of PLDI 2009, pp. 155–165. ACM, New York, NY, USA (2009) Dragojević, A., Guerraoui, R., Kapalka, M.: Stretching transactional memory. In: Proceedings of PLDI 2009, pp. 155–165. ACM, New York, NY, USA (2009)
11.
go back to reference Ennals, R.: Software transactional memory should not be obstruction-free. Technical report IRC-TR-06-052, Intel Research Cambridge Technical report, January 2006 Ennals, R.: Software transactional memory should not be obstruction-free. Technical report IRC-TR-06-052, Intel Research Cambridge Technical report, January 2006
12.
go back to reference McDonald, A., et al.: Characterization of TCC on chip-multiprocessors. In: 14th PACT 2005, pp. 63–74. IEEE Computer Society, Saint Louis, MO, USA, September 2005 McDonald, A., et al.: Characterization of TCC on chip-multiprocessors. In: 14th PACT 2005, pp. 63–74. IEEE Computer Society, Saint Louis, MO, USA, September 2005
13.
go back to reference Marathe, V.J., et al.: Lowering the overhead of nonblocking software transactional memory. Revised, University of Rochester, Computer Science Department, May 2006 Marathe, V.J., et al.: Lowering the overhead of nonblocking software transactional memory. Revised, University of Rochester, Computer Science Department, May 2006
14.
go back to reference Felber, P., Korland, G., Shavit, N.: Deuce: noninvasive concurrency with a java stm. In: Electronic Proceedings of MULTIPROG, p. 10 (2010) Felber, P., Korland, G., Shavit, N.: Deuce: noninvasive concurrency with a java stm. In: Electronic Proceedings of MULTIPROG, p. 10 (2010)
15.
go back to reference Halloway, S.: Programming Clojure, 1st edn. Pragmatic Bookshelf, Frisco (2009) Halloway, S.: Programming Clojure, 1st edn. Pragmatic Bookshelf, Frisco (2009)
16.
go back to reference Harris, T., Fraser, K.: Language support for lightweight transactions. ACM SIGPLAN Not. 38(11), 388–402 (2003)CrossRef Harris, T., Fraser, K.: Language support for lightweight transactions. ACM SIGPLAN Not. 38(11), 388–402 (2003)CrossRef
17.
go back to reference Harris, T., Marlow, S., Peyton Jones, S.: Haskell on a shared-memory multiprocessor. In: Haskell Workshop 2005, pp. 49–61, ACM Press, September 2005 Harris, T., Marlow, S., Peyton Jones, S.: Haskell on a shared-memory multiprocessor. In: Haskell Workshop 2005, pp. 49–61, ACM Press, September 2005
18.
go back to reference Harris, T., Marlow, S., Peyton Jones, S., Herlihy, M.: Composable memory transactions. In: PPoPP 2005, ACM Press (2005) Harris, T., Marlow, S., Peyton Jones, S., Herlihy, M.: Composable memory transactions. In: PPoPP 2005, ACM Press (2005)
19.
go back to reference Herlihy, M., Luchangco, V., Moir, M.: A flexible framework for implementing software transactional memory. SPNOTICES ACM SIGPLAN Not. 41, 253–262 (2006)CrossRef Herlihy, M., Luchangco, V., Moir, M.: A flexible framework for implementing software transactional memory. SPNOTICES ACM SIGPLAN Not. 41, 253–262 (2006)CrossRef
20.
go back to reference 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., 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)
21.
go back to reference Herlihy, M., Moss, J.E.B.: Transactional memory: architectural support for lock-free data structures. In: Proceedings of the 20th Annual International Symposium on Computer Architecture, pp. 289–300, May 1993 Herlihy, M., Moss, J.E.B.: Transactional memory: architectural support for lock-free data structures. In: Proceedings of the 20th Annual International Symposium on Computer Architecture, pp. 289–300, May 1993
22.
go back to reference Herlihy, M., Shavit, N.: The Art of Multiprocessor Programming. Morgan Kaufmann Publishers Inc., San Francisco (2008) Herlihy, M., Shavit, N.: The Art of Multiprocessor Programming. Morgan Kaufmann Publishers Inc., San Francisco (2008)
23.
go back to reference Hoare, C.A.R.: Towards a theory of parallel programming. In: Hoare, C.A.R., Perrott, R.H. (eds.) Operating System Techniques, pp. 61–71. Academic Press, New York (1972) Hoare, C.A.R.: Towards a theory of parallel programming. In: Hoare, C.A.R., Perrott, R.H. (eds.) Operating System Techniques, pp. 61–71. Academic Press, New York (1972)
24.
go back to reference 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) CrossRef 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) CrossRef
25.
go back to reference Hutton, G., Meijer, E.: Monadic parsing in haskell. J. Funct. Program. 8(4), 437–444 (1998)CrossRefMATH Hutton, G., Meijer, E.: Monadic parsing in haskell. J. Funct. Program. 8(4), 437–444 (1998)CrossRefMATH
26.
go back to reference Igarashi, A., Pierce, B., Wadler, P.: Featherweight java: a minimal core calculus for java and GJ. TOPLAS 23(3), 396–459 (2001)CrossRef Igarashi, A., Pierce, B., Wadler, P.: Featherweight java: a minimal core calculus for java and GJ. TOPLAS 23(3), 396–459 (2001)CrossRef
27.
go back to reference Marathe, V.J., Spear, M.F., Heriot, C., Acharya, A., Eisenstat, D., Scherer III, W.N., Scott, M.L.: Lowering the overhead of software transactional memory. Technical report TR 893, Computer Science Department, University of Rochester, Mar 2006 (Condensed version submitted for publication) Marathe, V.J., Spear, M.F., Heriot, C., Acharya, A., Eisenstat, D., Scherer III, W.N., Scott, M.L.: Lowering the overhead of software transactional memory. Technical report TR 893, Computer Science Department, University of Rochester, Mar 2006 (Condensed version submitted for publication)
28.
go back to reference 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) CrossRef 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) CrossRef
29.
go back to reference 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 (2001) 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 (2001)
30.
go back to reference Peyton Jones, S.: Haskell 98 language and libraries: the revised report. J. Funct. Program. 13(1), 1–255 (2003)MathSciNetMATH Peyton Jones, S.: Haskell 98 language and libraries: the revised report. J. Funct. Program. 13(1), 1–255 (2003)MathSciNetMATH
31.
go back to reference Peyton Jones, S.: Beautiful Concurrency. O’Reilly, Sebastopol (2007) Peyton Jones, S.: Beautiful Concurrency. O’Reilly, Sebastopol (2007)
32.
go back to reference Sonmez, N., Perfumo, C., Stipic, S., Cristal, A., Unsal, O.S., Valero, M.: Unreadtvar: extending haskell software transactional memory for performance. In: Trends in Functional Programming, vol. 8. Intellect Books, Bristol (2008) Sonmez, N., Perfumo, C., Stipic, S., Cristal, A., Unsal, O.S., Valero, M.: Unreadtvar: extending haskell software transactional memory for performance. In: Trends in Functional Programming, vol. 8. Intellect Books, Bristol (2008)
Metadata
Title
Composable Memory Transactions for Java Using a Monadic Intermediate Language
Authors
Rafael Bandeira
André R. Du Bois
Maurício Pilla
Juliana Vizzotto
Marcelo Machado
Copyright Year
2015
DOI
https://doi.org/10.1007/978-3-319-24012-1_10

Premium Partner