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.
- {n. d.}. Stanford Large Network Dataset Collection. http://snap.stanford.edu/. ({n. d.}).Google Scholar
- 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 Scholar
- 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 Scholar
Cross Ref
- 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 Scholar
Digital Library
- Andrew W. Appel. 1989. Simple Generational Garbage Collection and Fast Allocation. Software: Practice and Experience 19, 2 (1989), 171--183. Google Scholar
Digital Library
- 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 Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Robert D. Blumofe and Charles E. Leiserson. 1998. Space-Efficient Scheduling of Multithreaded Computations. SIAM J. Comput. 27, 1 (1998), 202--229. Google Scholar
Digital Library
- Robert D. Blumofe and Charles E. Leiserson. 1999. Scheduling multithreaded computations by work stealing. J. ACM 46 (Sept. 1999), 720--748. Issue 5. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- golang {n. d.}. The Go Programming Language. https://golang.org. ({n. d.}). Accessed: 2017.Google Scholar
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Maurice Herlihy and Nir Shavit. 2011. The Art of Multiprocessor Programming. Morgan Kaufmann. Google Scholar
Digital Library
- 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 Scholar
Cross Ref
- Richard Jones, Antony Hosking, and Eliot Moss. 2012. The Garbage Collection Handbook: The Art of Automatic Memory Management. Chapman & Hall. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Doug Lea. 2000. A Java fork/join framework. In Proceedings of the ACM 2000 conference on Java Grande (JAVA '00). 36--43. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- MLton {n. d.}. MLton web site. http://www.mlton.org. ({n. d.}).Google Scholar
- Ryan Newton. 2017. (2017). Indiana University. Personal Communication.Google Scholar
- Rishiyur S. Nikhil. 1991. Id Language Reference Manual. (1991).Google Scholar
- Ram Raghunathan, Stefan K. Muller, Umut A. Acar, and Guy Blelloch. 2016. Hierarchical Memory Management for Parallel Programs. In ICFP 2016. ACM Press. Google Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- Philip Wadler. 1998. Why No One Uses Functional Languages. SIGPLAN Notices 33, 8 (1998), 23--27. Google Scholar
Digital Library
Index Terms
- Hierarchical memory management for mutable state
Recommendations
Hierarchical memory management for mutable state
PPoPP '18: Proceedings of the 23rd ACM SIGPLAN Symposium on Principles and Practice of Parallel ProgrammingIt 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 ...
Quantifying the performance of garbage collection vs. explicit memory management
Proceedings of the 20th annual ACM SIGPLAN conference on Object oriented programming systems languages and applicationsGarbage collection yields numerous software engineering benefits, but its quantitative impact on performance remains elusive. One can compare the cost of conservative garbage collection to explicit memory management in C/C++ programs by linking in an ...
Quantifying the performance of garbage collection vs. explicit memory management
OOPSLA '05: Proceedings of the 20th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applicationsGarbage collection yields numerous software engineering benefits, but its quantitative impact on performance remains elusive. One can compare the cost of conservative garbage collection to explicit memory management in C/C++ programs by linking in an ...






Comments