multicore - 多核 llvm 的垃圾收集器?

标签 multicore llvm garbage-collection

很长一段时间以来,我一直将 LLVM 视为我目前正在实现的语言的新后端。它似乎具有良好的性能,相当高级的生成 API,足够的低级支持来优化奇特的优化。此外,虽然我自己没有检查过,但苹果似乎已经成功地演示了将 LLVM 用于垃圾收集的多核程序。

到现在为止还挺好。因为我对垃圾收集和多核都感兴趣,所以下一步是选择一个 LLVM 多核垃圾收集器。这让我想到了一个问题:什么是可用的?我知道 Jon Harrop的 HLVM 工作,但仅此而已。

请注意,我需要跨平台,所以 Apple 的 GC 可能不是我想要的(除非有跨平台版本)。另请注意,我不反对 stop-the-world 垃圾收集器。

提前致谢,
约里克

最佳答案

LLVM docs say that it does not support multi-threaded collectors然而。

As the matrix indicates, LLVM's garbage collection infrastructure is already suitable for a wide variety of collectors, but does not currently extend to multithreaded programs. This will be added in the future as there is interest.



文档确实说要进行多线程垃圾收集,您需要停止世界,并且这是不可移植的东西:

Threaded Denotes a multithreaded mutator; the collector must still stop the mutator ("stop the world") before beginning reachability analysis. Stopping a multithreaded mutator is a complicated problem. It generally requires highly platform specific code in the runtime, and the production of carefully designed machine code at safe points.



然而,线程之间的共享状态是一个令人讨厌的缩放问题。如果您的语言仅通过“任务”之间的消息传递进行通信,因此在工作线程之间没有共享状态,那么您可以对每线程堆使用每线程收集器吗?

关于multicore - 多核 llvm 的垃圾收集器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2271140/

相关文章:

clang-format 对已格式化的文件进行更改

java - 是否收集了未使用的 JPA 实体垃圾?为什么?

java - Solr CoreAware FilterFactory

c# - 是否可以在一个 Excel 实例中使用多核?

multithreading - TPL 有何过人之处

.net 垃圾收集和托管资源

c# - 一些异步套接字代码 - 帮助垃圾收集?

c# - 使用多核(线程)处理器进行 FOR 循环

c++ - "Live"代码和使用 C++ 和 LLVM JIT 的快速原型(prototype)制作?

c++ - 使用 Frama-Clang 插件时出错