Provably space-efficient parallel functional programming
Jatin Arora, Sam Westrick, Umut A. Acar
Abstract
Because of its many desirable properties, such as its ability to control effects and thus potentially disastrous race conditions, functional programming offers a viable approach to programming modern multicore computers. Over the past decade several parallel functional languages, typically based on dialects of ML and Haskell, have been developed. These languages, however, have traditionally underperformed procedural languages (such as C and Java). The primary reason for this is their hunger for memory, which only grows with parallelism, causing traditional memory management techniques to buckle under increased demand for memory. Recent work opened a new angle of attack on this problem by identifying a memory property of determinacy-race-free parallel programs, called disentanglement, which limits the knowledge of concurrent computations about each other’s memory allocations. The work has showed some promise in delivering good time scalability. In this paper, we present provably space-efficient automatic memory management techniques for determinacy-race-free functional parallel programs, allowing both pure and imperative programs where memory may be destructively updated. We prove that for a program with sequential live memory of R * , any P -processor garbage-collected parallel run requires at most O ( R * · P ) memory. We also prove a work bound of O ( W + R * P ) for P -processor executions, accounting also for the cost of garbage collection. To achieve these results, we integrate thread scheduling with memory management. The idea is to coordinate memory allocation and garbage collection with thread scheduling decisions so that each processor can allocate memory without synchronization and independently collect a portion of memory by consulting a collection policy, which we formulate. The collection policy is fully distributed and does not require communicating with other processors. We show that the approach is practical by implementing it as an extension to the MPL compiler for Parallel ML. Our experimental results confirm our theoretical bounds and show that the techniques perform and scale well.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext d42b7719-5e54-495e-84b5-ca01eb0580e1Cited by top-tier papers8
- Task parallel assembly language for uncompromising parallelismMike Rainey, Ryan R. Newton, Kyle C. Hale, Nikos Hardavellas et al.PLDI 2021 · 9 citations
- Automatic Parallelism ManagementSam Westrick, Matthew Fluet, Mike Rainey, Umut A. AcarPOPL 2024 · 7 citations
- Efficient Parallel Functional Programming with EffectsJatin Arora, Sam Westrick, Umut A. AcarPLDI 2023 · 6 citations
- Responsive Parallelism with SynchronizationStefan K. Muller, Kyle Singer, Devyn Terra Keeney, Andrew Neth et al.PLDI 2023 · 3 citations
- Parallelism in a Region Inference ContextMartin Elsman, Troels HenriksenPLDI 2023 · 2 citations
Builds on2
Related papers
- Disentanglement with Futures, State, and InteractionJatin Arora, Stefan K. Muller, Umut A. AcarPOPL 2024
- DisLog: A Separation Logic for DisentanglementAlexandre Moine, Sam Westrick, Stephanie BalzerPOPL 2024
- TypeDis: A Type System for DisentanglementAlexandre Moine, Stephanie Balzer, Alex Xu, Sam WestrickPOPL 2026 · 1 citation
- Do you have space for dessert? a verified space cost semantics for CakeML programsAlejandro Gómez-Londoño, Johannes Åman Pohjola, Hira Taqdees Syeda, Magnus O. Myreen et al.OOPSLA 2020 · 12 citations
- Explicit Effects and Effect Constraints in ReMLMartin ElsmanPOPL 2024 · 4 citations
