一句话:为 OCaml 设计并实现支持多核并行的 mostly-concurrent GC,兼顾单线程向后兼容与多核扩展性。
OCaml 是工业级多范式托管语言,却长期不支持共享内存并行。本文为 OCaml 的多核扩展设计并完整实现了一个 mostly-concurrent 垃圾收集器,目标是在加入并行能力的同时保持向后兼容:既保留语言特性,也维持单线程代码在新 GC 下的性能。为此作者提出一系列新技术,并通过实现与评测表明,新 GC 在顺序程序性能与特性兼容之间取得平衡,并且能在现代多核处理器上良好扩展。
OCaml is an industrial-strength, multi-paradigm programming language, widely used in industry and academia. OCaml is also one of the few modern managed system programming languages to lack support for shared memory parallel programming. This paper describes the design, a full-fledged implementation and evaluation of a mostly-concurrent garbage collector (GC) for the multicore extension of the OCaml programming language. Given that we propose to add parallelism to a widely used programming language with millions of lines of existing code, we face the challenge of maintaining backwards compatibility--not just in terms of the language features but also the performance of single-threaded code running with the new GC. To this end, the paper presents a series of novel techniques and demonstrates that the new GC strikes a balance between performance and feature backwards compatibility for sequential programs and scales admirably on modern multicore processors.
DOI 原文 · arXiv · PDF(开放获取) · DBLP
@article{Sivaramakrishnan20,
title = {Retrofitting parallelism onto OCaml},
author = {KC Sivaramakrishnan and Stephen Dolan and Leo White and Sadiq Jaffer and Tom Kelly and Anmol Sahoo and Sudha Parimala and Atul Dhiman and Anil Madhavapeddy},
journal = {Proceedings of the ACM on Programming Languages},
volume = {4},
number = {ICFP},
year = {2020},
doi = {10.1145/3408995}
}