skip to main content
10.1145/3122955.3122972acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article
Public Access

Improving STM performance with transactional structs

Published:07 September 2017Publication History

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.

References

  1. Phil Bagwell. 2001. Ideal hash trees. Technical Report. School of Computer and Communication Sciences, EPFL. http://lampwww.epfl.ch/papers/idealhashtrees. pdf .Google ScholarGoogle Scholar
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. Keir Fraser. 2004. Practical lock-freedom. Ph.D. Dissertation. University of Cambridge Computer Laboratory.Google ScholarGoogle Scholar
  4. Keir Fraser and Tim Harris. 2007. Concurrent programming without locks. ACM Trans. on Computer Systems (TOCS) 25, 2 (2007). Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  6. Timothy L. Harris, James R. Larus, and Ravi Rajwar. 2010. Transactional Memory (second ed.). Morgan & Claypool, San Francisco, CA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. Maurice Herlihy and Nir Shavit. 2008. The Art of Multiprocessor Programming. Morgan Kaufmann Publishers. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  10. Simon Marlow. 2016. Mutable Constructor Fields. (2016). https: //github.com/simonmar/ghc-proposals/blob/mutable-fields/proposals/ 0000-mutable-fields.rstGoogle ScholarGoogle Scholar
  11. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  12. 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 ScholarGoogle Scholar
  13. 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 ScholarGoogle Scholar
  14. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  15. Rasmus Pagh and Flemming Friche Rodler. 2004. Cuckoo hashing. Journal of Algorithms 51, 2 (2004). Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. 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 ScholarGoogle Scholar
  17. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  18. William Pugh. 1990. Skip Lists: A Probabilistic Alternative to Balanced Trees. Commun. ACM 33, 6 (June 1990). Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Michael Schröder. 2013. ctrie: Non-blocking concurrent map. (2013). http: //hackage.haskell.org/package/ctrieGoogle ScholarGoogle Scholar
  20. Johan Tibell. 2012. unordered-containers: Efficient hashing-based container types. (2012). http://hackage.haskell.org/package/unordered-containersGoogle ScholarGoogle Scholar
  21. Nikita Volkov. 2016. stm-containers: Containers for STM. (2016). https://hackage. haskell.org/package/stm-containersGoogle ScholarGoogle Scholar

Index Terms

  1. Improving STM performance with transactional structs

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in
        • Published in

          cover image ACM Conferences
          Haskell 2017: Proceedings of the 10th ACM SIGPLAN International Symposium on Haskell
          September 2017
          211 pages
          ISBN:9781450351829
          DOI:10.1145/3122955
          • cover image ACM SIGPLAN Notices
            ACM SIGPLAN Notices  Volume 52, Issue 10
            Haskell '17
            October 2017
            211 pages
            ISSN:0362-1340
            EISSN:1558-1160
            DOI:10.1145/3156695
            • Editor:
            • Andy Gill
            Issue’s Table of Contents

          Copyright © 2017 ACM

          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 7 September 2017

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article

          Acceptance Rates

          Overall Acceptance Rate57of143submissions,40%

          Upcoming Conference

          ICFP '24

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader