Skip to main content

An Implementation of Composable Memory Transactions in Haskell

  • Conference paper
Software Composition (SC 2011)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 6708))

Included in the following conference series:

Abstract

This paper describes an implementation of STM Haskell [11] in Haskell using the Transactional Locking 2 (TL2) algorithm by Dice, Shalev, and Shavit. TL2 provides an important characteristic that makes it suitable for implementing transactions as a library: it efficiently avoids periods of unsafe execution, guaranteeing that transactions always see a consistent state of memory. Preliminary measurements suggest that our library performs reasonably well, and provides similar scalability to the original STM Haskell runtime system, that was implemented in C. The implementation presented in this paper could work as a testbed to experiment with new extensions for STM Haskell. As an example, we demonstrate how to modify the basic library to support the unreadTVar [20] construct.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Heterogenous collections in Haskell (October 2010), http://www.haskell.org/haskellwiki/Heterogenous_collections

  2. The Haskell STM Benchmark. WWW page (October 2010), http://www.bscmsrc.eu/software/haskell-stm-benchmark

  3. Twilight STM for Haskell. WWW page (October 2010), http://proglang.informatik.uni-freiburg.de/projects/twilight/

  4. TL2 STM Haskell. WWW page (February 2011), https://sites.google.com/site/tl2stmhaskell/STM.hs

  5. Bieniusa, A., Middelkoop, A., Thiermann, P.: Twilight in Haskell: Software Transactional Memory with Safe I/O and Typed Conflict Management. In: Preprocedings of IFL 2010 (September 2010)

    Google Scholar 

  6. 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)

    Chapter  Google Scholar 

  7. Felber, P., Fetzer, C., Riegel, T.: Dynamic performance tuning of word-based software transactional memory. In: PPoPP 2008, pp. 237–246. ACM, New York (2008)

    Google Scholar 

  8. Harris, T., Fraser, K.: Language support for lightweight transactions. SIGPLAN Not. 38(11), 388–402 (2003)

    Article  Google Scholar 

  9. Harris, T., Larus, J.R., Rajwar, R.: Transactional Memory, 2nd edn. Morgan & Claypool Publishers, San Francisco (2010)

    Google Scholar 

  10. Harris, T., Marlow, S., Peyton Jones, S.: Haskell on a shared-memory multiprocessor. In: Haskell Workshop 2005, pp. 49–61. ACM, New York (2005)

    Google Scholar 

  11. Harris, T., Marlow, S., Peyton Jones, S., Herlihy, M.: Composable memory transactions. In: PPoPP 2005. ACM Press, New York (2005)

    Google Scholar 

  12. Harris, T., Peyton Jones, S.: Transactional memory with data invariants. In: TRANSACT 2006 (June 2006)

    Google Scholar 

  13. Harris, T., Plesko, M., Shinnar, A., Tarditi, D.: Optimizing memory transactions. SIGPLAN Not. 41(6), 14–25 (2006)

    Article  Google Scholar 

  14. Huch, F., Kupke, F.: A high-level implementation of composable memory transactions in concurrent haskell. In: IFL, pp. 124–141 (2005)

    Google Scholar 

  15. Kiselyov, O., Lämmel, R., Schupke, K.: Strongly typed heterogeneous collections. In: Haskell Workshop 2004, pp. 96–107. ACM Press, New York (2004)

    Google Scholar 

  16. Lourenço, A., Cunha, G.: Testing patterns for software transactional memory engines. In: PADTAD 2007, pp. 36–42. ACM, New York (2007)

    Google Scholar 

  17. Perfumo, C., Sönmez, N., Stipic, S., Unsal, O., Cristal, A., Harris, T., Valero, M.: The limits of software transactional memory (STM): dissecting haskell stm applications on a many-core environment. In: CF 2008, pp. 67–78. ACM Press, New York (2008)

    Google Scholar 

  18. Peyton Jones, S., Marlow, S., Elliot, C.: Stretching the storage manager: weak pointers and stable names in haskell. In: Koopman, P., Clack, C. (eds.) IFL 1999. LNCS, vol. 1868, Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  19. Riegel, T., Felber, P., Fetzer, C.: A Lazy Snapshot Algorithm with Eager Validation, pp. 284–298 (2006)

    Google Scholar 

  20. 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 (2008)

    Google Scholar 

  21. Sulzmann, M., Lam, E.S., Marlow, S.: Comparing the performance of concurrent linked-list implementations in Haskell. SIGPLAN Not. 44(5), 11–20 (2009)

    Article  Google Scholar 

  22. Zhang, R., Budimlić, Z., Scherer III., W.N.: Commit phase in timestamp-based STM. In: SPAA 2008, pp. 326–335. ACM Press, New York (2008)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2011 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Du Bois, A.R. (2011). An Implementation of Composable Memory Transactions in Haskell. In: Apel, S., Jackson, E. (eds) Software Composition. SC 2011. Lecture Notes in Computer Science, vol 6708. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-22045-6_3

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-22045-6_3

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-22044-9

  • Online ISBN: 978-3-642-22045-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics