ABSTRACT
Software transactional memory (STM) has made it significantly easier to write correct concurrent programs in Haskell. Its performance, however, is limited by several inefficiencies. While safe concurrent computations are easy to express in Haskell's STM, concurrent data structures suffer unfortunate bloat in the implementation due to an extra level of indirection for mutable references as well as the inability to express unboxed mutable transactional values. We address these deficiencies by introducing TStruct to the GHC run-time system, allowing strict unboxed transactional values as well as mutable references without an extra indirection. Using TStruct we implement several data structures, discuss their design, and provide benchmark results on a large multicore machine. Our benchmarks show that concurrent data structures built with TStruct out-scale and out-perform their TVar-based equivalents.
- Phil Bagwell. 2001. Ideal hash trees. Technical Report. School of Computer and Communication Sciences, EPFL. http://lampwww.epfl.ch/papers/idealhashtrees. pdf .Google Scholar
- Luke Dalessandro, Michael F. Spear, and Michael L. Scott. 2010. NOrec: Streamlining STM by Abolishing Ownership Records. In Proc. of the 15th ACM Symp. on Principles and Practice of Parallel Programming (PPoPP). Bangalore, India. Google ScholarDigital Library
- Keir Fraser. 2004. Practical lock-freedom. Ph.D. Dissertation. University of Cambridge Computer Laboratory.Google Scholar
- Keir Fraser and Tim Harris. 2007. Concurrent programming without locks. ACM Trans. on Computer Systems (TOCS) 25, 2 (2007). Google ScholarDigital Library
- Tim Harris, Simon Marlow, Simon Peyton Jones, and Maurice Herlihy. 2005. Composable memory transactions. In Proc. of the 10th ACM Symp. on Principles and Practice of Parallel Programming (PPoPP). Chicago, IL, USA. Google ScholarDigital Library
- Timothy L. Harris, James R. Larus, and Ravi Rajwar. 2010. Transactional Memory (second ed.). Morgan & Claypool, San Francisco, CA. Google ScholarDigital Library
- Maurice Herlihy and Eric Koskinen. 2008. Transactional Boosting: A Methodology for Highly-concurrent Transactional Objects. In Proc. of the 13th ACM Symp. on Principles and Practice of Parallel Programming (PPoPP). Salt Lake City, UT, USA. Google ScholarDigital Library
- Maurice Herlihy and Nir Shavit. 2008. The Art of Multiprocessor Programming. Morgan Kaufmann Publishers. Google ScholarDigital Library
- Matthew Le, Ryan Yates, and Matthew Fluet. 2016. Revisiting Software Transactional Memory in Haskell. In Proc. of the 9th Intl. Symp. on Haskell. Nara, Japan. Google ScholarDigital Library
- Simon Marlow. 2016. Mutable Constructor Fields. (2016). https: //github.com/simonmar/ghc-proposals/blob/mutable-fields/proposals/ 0000-mutable-fields.rstGoogle Scholar
- Simon Marlow, Tim Harris, Roshan P James, and Simon Peyton Jones. 2008. Parallel generational-copying garbage collection with a block-structured heap. In Proc. of the 7th Intl. Symp. on Memory Management. Tucson, AZ, USA. Google ScholarDigital Library
- Chi Cao Minh, JaeWoong Chung, Christos Kozyrakis, and Kunle Olukotun. 2008. STAMP: Stanford transactional applications for multi-processing. In IEEE Intl. Symp. on Workload Characterization (IISWC). Seattle, WA, USA.Google Scholar
- Ryan R. Newton. 2016. atomic-primops: A safe approach to CAS and other atomic ops in Haskell. (2016). http://hackage.haskell.org/package/atomic-primopsGoogle Scholar
- Ryan R. Newton, Peter P. Fogg, and Ali Varamesh. 2015. Adaptive Lock-free Maps: Purely-functional to Scalable. In Proc. of the 20th ACM SIGPLAN Intl. Conf. on Functional Programming (ICFP). Vancouver, BC, Canada. Google ScholarDigital Library
- Rasmus Pagh and Flemming Friche Rodler. 2004. Cuckoo hashing. Journal of Algorithms 51, 2 (2004). Google ScholarDigital Library
- Aleksandar Prokopec, Phil Bagwell, and Martin Odersky. 2011. Cache-Aware Lock-Free Concurrent Hash Tries. Technical Report. School of Computer and Communication Sciences, EPFL. https://infoscience.epfl.ch/record/166908 .Google Scholar
- Aleksandar Prokopec, Nathan Grasso Bronson, Phil Bagwell, and Martin Odersky. 2012. Concurrent tries with efficient non-blocking snapshots. In Proc. of the 17th ACM Symp. on Principles and Practice of Parallel Programming (PPoPP). New Orleans, LA, USA. Google ScholarDigital Library
- William Pugh. 1990. Skip Lists: A Probabilistic Alternative to Balanced Trees. Commun. ACM 33, 6 (June 1990). Google ScholarDigital Library
- Michael Schröder. 2013. ctrie: Non-blocking concurrent map. (2013). http: //hackage.haskell.org/package/ctrieGoogle Scholar
- Johan Tibell. 2012. unordered-containers: Efficient hashing-based container types. (2012). http://hackage.haskell.org/package/unordered-containersGoogle Scholar
- Nikita Volkov. 2016. stm-containers: Containers for STM. (2016). https://hackage. haskell.org/package/stm-containersGoogle Scholar
Index Terms
- Improving STM performance with transactional structs
Recommendations
Improving STM performance with transactional structs
Haskell '17Software transactional memory (STM) has made it significantly easier to write correct concurrent programs in Haskell. Its performance, however, is limited by several inefficiencies. While safe concurrent computations are easy to express in Haskell's STM,...
Revisiting software transactional memory in Haskell
Haskell '16Software Transactional Memory (STM) has become very popular in Haskell. Currently, there are nearly 500 packages on Haskell’s package archive that directly use STM. Despite the widespread use in real world applications, Haskell’s STM implementation has ...
Revisiting software transactional memory in Haskell
Haskell 2016: Proceedings of the 9th International Symposium on HaskellSoftware Transactional Memory (STM) has become very popular in Haskell. Currently, there are nearly 500 packages on Haskell’s package archive that directly use STM. Despite the widespread use in real world applications, Haskell’s STM implementation has ...
Comments