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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Heterogenous collections in Haskell (October 2010), http://www.haskell.org/haskellwiki/Heterogenous_collections
The Haskell STM Benchmark. WWW page (October 2010), http://www.bscmsrc.eu/software/haskell-stm-benchmark
Twilight STM for Haskell. WWW page (October 2010), http://proglang.informatik.uni-freiburg.de/projects/twilight/
TL2 STM Haskell. WWW page (February 2011), https://sites.google.com/site/tl2stmhaskell/STM.hs
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)
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)
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)
Harris, T., Fraser, K.: Language support for lightweight transactions. SIGPLAN Not. 38(11), 388–402 (2003)
Harris, T., Larus, J.R., Rajwar, R.: Transactional Memory, 2nd edn. Morgan & Claypool Publishers, San Francisco (2010)
Harris, T., Marlow, S., Peyton Jones, S.: Haskell on a shared-memory multiprocessor. In: Haskell Workshop 2005, pp. 49–61. ACM, New York (2005)
Harris, T., Marlow, S., Peyton Jones, S., Herlihy, M.: Composable memory transactions. In: PPoPP 2005. ACM Press, New York (2005)
Harris, T., Peyton Jones, S.: Transactional memory with data invariants. In: TRANSACT 2006 (June 2006)
Harris, T., Plesko, M., Shinnar, A., Tarditi, D.: Optimizing memory transactions. SIGPLAN Not. 41(6), 14–25 (2006)
Huch, F., Kupke, F.: A high-level implementation of composable memory transactions in concurrent haskell. In: IFL, pp. 124–141 (2005)
Kiselyov, O., Lämmel, R., Schupke, K.: Strongly typed heterogeneous collections. In: Haskell Workshop 2004, pp. 96–107. ACM Press, New York (2004)
Lourenço, A., Cunha, G.: Testing patterns for software transactional memory engines. In: PADTAD 2007, pp. 36–42. ACM, New York (2007)
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)
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)
Riegel, T., Felber, P., Fetzer, C.: A Lazy Snapshot Algorithm with Eager Validation, pp. 284–298 (2006)
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)
Sulzmann, M., Lam, E.S., Marlow, S.: Comparing the performance of concurrent linked-list implementations in Haskell. SIGPLAN Not. 44(5), 11–20 (2009)
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)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)