skip to main content
research-article
Public Access

Hierarchical memory management for mutable state

Published:10 February 2018Publication History
Skip Abstract Section

Abstract

It is well known that modern functional programming languages are naturally amenable to parallel programming. Achieving efficient parallelism using functional languages, however, remains difficult. Perhaps the most important reason for this is their lack of support for efficient in-place updates, i.e., mutation, which is important for the implementation of both parallel algorithms and the run-time system services (e.g., schedulers and synchronization primitives) used to execute them.

In this paper, we propose techniques for efficient mutation in parallel functional languages. To this end, we couple the memory manager with the thread scheduler to make reading and updating data allocated by nested threads efficient. We describe the key algorithms behind our technique, implement them in the MLton Standard ML compiler, and present an empirical evaluation. Our experiments show that the approach performs well, significantly improving efficiency over existing functional language implementations.

References

  1. {n. d.}. Stanford Large Network Dataset Collection. http://snap.stanford.edu/. ({n. d.}).Google ScholarGoogle Scholar
  2. Umut A. Acar, Guy Blelloch, Matthew Fluet, and Stefan K. Mullerand Ram Raghunathan. 2015. Coupling Memory and Computation for Locality Management. In Summit on Advances in Programming Languages (SNAPL).Google ScholarGoogle Scholar
  3. Umut A. Acar, Guy E. Blelloch, and Robert D. Blumofe. 2002. The Data Locality of Work Stealing. Theory of Computing Systems 35, 3 (2002), 321--347.Google ScholarGoogle ScholarCross RefCross Ref
  4. Todd A. Anderson. 2010. Optimizations in a Private Nursery-Based Garbage Collector. In 9th International Symposium on Memory Management, Jan Vitek and Doug Lea (Eds.). ACM Press, Toronto, Canada, 21--30. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Andrew W. Appel. 1989. Simple Generational Garbage Collection and Fast Allocation. Software: Practice and Experience 19, 2 (1989), 171--183. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Andrew W. Appel and Zhong Shao. 1996. Empirical and analytic study of stack versus heap cost for languages with closures. Journal of Functional Programming 6, 1 (Jan. 1996), 47--74.Google ScholarGoogle ScholarCross RefCross Ref
  7. Sven Auhagen, Lars Bergstrom, Matthew Fluet, and John H. Reppy. 2011. Garbage collection for multicore NUMA machines. In Proceedings of the 2011 ACM SIGPLAN workshop on Memory Systems Performance and Correctness (MSPC). 51--57. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Guy E. Blelloch, Jeremy T. Fineman, Phillip B. Gibbons, and Harsha Vardhan Simhadri. 2011. Scheduling irregular parallel computations on hierarchical caches. In Proc. ACM Symposium on Parallelism in Algorithms and Architectures (SPAA). 355--366. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Guy E. Blelloch, Jonathan C. Hardwick, Jay Sipelstein, Marco Zagha, and Siddhartha Chatterjee. 1994. Implementation of a Portable Nested Data-Parallel Language. J. Parallel Distrib. Comput. 21, 1 (1994), 4--14. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Robert D. Blumofe and Charles E. Leiserson. 1998. Space-Efficient Scheduling of Multithreaded Computations. SIAM J. Comput. 27, 1 (1998), 202--229. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Robert D. Blumofe and Charles E. Leiserson. 1999. Scheduling multithreaded computations by work stealing. J. ACM 46 (Sept. 1999), 720--748. Issue 5. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Philippe Charles, Christian Grothoff, Vijay Saraswat, Christopher Donawa, Allan Kielstra, Kemal Ebcioglu, Christoph von Praun, and Vivek Sarkar. 2005. X10: an object-oriented approach to non-uniform cluster computing. In Proceedings of the 20th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications (OOPSLA '05). ACM, 519--538. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Damien Doligez and Georges Gonthier. 1994. Portable, Unobtrusive Garbage Collection for Multiprocessor Systems. In 21st Annual ACM Symposium on Principles of Programming Languages. ACM Press, Portland, OR, 70--83. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Damien Doligez and Xavier Leroy. 1993. A Concurrent Generational Garbage Collector for a Multi-Threaded Implementation of ML. In 20th Annual ACM Symposium on Principles of Programming Languages. ACM Press, Charleston, SC, 113--123. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Tamar Domani, Elliot K. Kolodner, Ethan Lewis, Erez Petrank, and Dafna Sheinwald. 2002. Thread-Local Heaps for Java. In 3rd International Symposium on Memory Management (ACM SIGPLAN Notices 38(2 supplement)), Hans-J. Boehm and David Detlefs (Eds.). ACM Press, Berlin, Germany, 76--87. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Matthew Fluet, Mike Rainey, John Reppy, and Adam Shaw. 2011. Implicitly threaded parallelism in Manticore. Journal of Functional Programming 20, 5--6 (2011), 1--40. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. golang {n. d.}. The Go Programming Language. https://golang.org. ({n. d.}). Accessed: 2017.Google ScholarGoogle Scholar
  18. Marcelo J. R. Gonçalves. 1995. Cache Performance of Programs with Intensive Heap Allocation and Generational Garbage Collection. Ph.D. Dissertation. Department of Computer Science, Princeton University.Google ScholarGoogle Scholar
  19. Marcelo J. R. Gonçalves and Andrew W. Appel. 1995. Cache Performance of Fast-Allocating Programs. In Conference on Functional Programming and Computer Architecture. ACM Press, La Jolla, CA, 293--305. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Adrien Guatto, Sam Westrick, Ram Raghunathan, Umut Acar, and Matthew Fluet. 2018. Hierarchical Memory Management for Mutable State: Extended Technical Appendix. (2018). arXiv:1801.04618 Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Maurice Herlihy and Nir Shavit. 2011. The Art of Multiprocessor Programming. Morgan Kaufmann. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Shams Mahmood Imam and Vivek Sarkar. 2014. Habanero-Java library: a Java 8 framework for multicore programming. In 2014 International Conference on Principles and Practices of Programming on the Java Platform Virtual Machines, Languages and Tools, PPPJ '14. 75--86. Google ScholarGoogle ScholarCross RefCross Ref
  23. Richard Jones, Antony Hosking, and Eliot Moss. 2012. The Garbage Collection Handbook: The Art of Automatic Memory Management. Chapman & Hall. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Gabriele Keller, Manuel M.T. Chakravarty, Roman Leshchinskiy, Simon Peyton Jones, and Ben Lippmeier. 2010. Regular, shape-polymorphic, parallel arrays in Haskell. In Proceedings of the 15th ACM SIGPLAN international conference on Functional programming (ICFP '10). 261--272. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Matthew Le and Matthew Fluet. 2015. Partial Aborts for Transactions via First-class Continuations. In Proceedings of the 20th ACM SIGPLAN International Conference on Functional Programming (ICFP 2015). 230--242. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Doug Lea. 2000. A Java fork/join framework. In Proceedings of the ACM 2000 conference on Java Grande (JAVA '00). 36--43. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Daan Leijen, Wolfram Schulte, and Sebastian Burckhardt. 2009. The design of a task parallel library. In Proceedings of the 24th ACM SIGPLAN conference on Object Oriented Programming Systems Languages and Applications (OOPSLA '09). 227--242. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Simon Marlow and Simon L. Peyton Jones. 2011. Multicore Garbage Collection with Local Heaps. In 10th International Symposium on Memory Management, Hans Boehm and David Bacon (Eds.). ACM Press, San Jose, CA, 21--32. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. MLton {n. d.}. MLton web site. http://www.mlton.org. ({n. d.}).Google ScholarGoogle Scholar
  30. Ryan Newton. 2017. (2017). Indiana University. Personal Communication.Google ScholarGoogle Scholar
  31. Rishiyur S. Nikhil. 1991. Id Language Reference Manual. (1991).Google ScholarGoogle Scholar
  32. Ram Raghunathan, Stefan K. Muller, Umut A. Acar, and Guy Blelloch. 2016. Hierarchical Memory Management for Parallel Programs. In ICFP 2016. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. K. C. Sivaramakrishnan, Lukasz Ziarek, and Suresh Jagannathan. 2014. MultiMLton: A multicore-aware runtime for standard ML. Journal of Functional Programming FirstView (6 2014), 1--62.Google ScholarGoogle Scholar
  34. Daniel Spoonhower, Guy E. Blelloch, Robert Harper, and Phillip B. Gibbons. 2010. Space profiling for parallel functional programs. Journal of Functional Programming 20 (2010), 417--461. Issue Special Issue 5--6. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Philip Wadler. 1998. Why No One Uses Functional Languages. SIGPLAN Notices 33, 8 (1998), 23--27. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Hierarchical memory management for mutable state

      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

      Full Access

      • Published in

        cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 53, Issue 1
        PPoPP '18
        January 2018
        426 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/3200691
        Issue’s Table of Contents
        • cover image ACM Conferences
          PPoPP '18: Proceedings of the 23rd ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming
          February 2018
          442 pages
          ISBN:9781450349826
          DOI:10.1145/3178487

        Copyright © 2018 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 the author(s) 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: 10 February 2018

        Check for updates

        Qualifiers

        • research-article

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader