Skip to main content

2015 | OriginalPaper | Buchkapitel

Composable Memory Transactions for Java Using a Monadic Intermediate Language

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

Erschienen in: Programming Languages

Verlag: Springer International Publishing

Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.

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.

Sie haben noch keine Lizenz? Dann Informieren Sie sich jetzt über unsere Produkte:

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!

Literatur
5.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat Halloway, S.: Programming Clojure, 1st edn. Pragmatic Bookshelf, Frisco (2009) Halloway, S.: Programming Clojure, 1st edn. Pragmatic Bookshelf, Frisco (2009)
16.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat Peyton Jones, S.: Beautiful Concurrency. O’Reilly, Sebastopol (2007) Peyton Jones, S.: Beautiful Concurrency. O’Reilly, Sebastopol (2007)
32.
Zurück zum Zitat 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)
Metadaten
Titel
Composable Memory Transactions for Java Using a Monadic Intermediate Language
verfasst von
Rafael Bandeira
André R. Du Bois
Maurício Pilla
Juliana Vizzotto
Marcelo Machado
Copyright-Jahr
2015
DOI
https://doi.org/10.1007/978-3-319-24012-1_10