OCaml并行化能力的状态如何? [英] What is the state of OCaml's parallelization abilities?

查看:84
本文介绍了OCaml并行化能力的状态如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对将OCaml用于一个项目很感兴趣,但是我不确定它的并行化能力在哪里. OCaml中有消息传递功能吗? OCaml是否可以有效使用1个以上的CPU?

I'm interested in using OCaml for a project, however I'm not sure about where its parallelization capabilities are anymore. Is there a message passing ability in OCaml? Is OCaml able to efficiently use more than 1 CPU?

我在该主题上阅读的大部分内容都是2002-2006年撰写的,而我最近没有看到任何内容.

Most of what I have read on the subject was written in 2002-2006, and I haven't seen anything more recent.

谢谢!

推荐答案

Caml每周新闻("CWN",有趣的消息摘要)的2009年版 骆驼列表)显示:

This 2009 issue of the Caml weekly news ("CWN", a digest of interesting messages from the caml list) shows that:

  • the official party line on threads and Ocaml hasn't changed. A notable quote:

(...)通常,整个标准库都不是线程安全的.可能应该在 线程库的文档,但是按照标准库模块对其进行文档化并没有多大意义. -X. Leroy

(...) in general, the whole standard library is not thread-safe. Probably that should be stated in the documentation for the threads library, but there isn't much point in documenting it per standard library module. -- X. Leroy

(有关Ocaml线程如何仍然有用的信息,请参见罪魁祸首本人在另一个关于SO的问题中的评论)

(for how Ocaml threads can still be useful, see a remark by the culprit himself in another question on SO)

并行性最常采用的范例是消息传递,值得注意的是X.Leroy的 SPMD 样式提供针对 MPI标准. 我在上面指出的同一CWN问题提供了对示例的引用,并且许多其他相关项目.

the most frequently adopted paradigm for parallelism is message-passing, and of note is X. Leroy's OcamlMPI, providing bindings for programming in SPMD style against the MPI standard. The same CWN issue I pointed to above provides references to examples, and numerous other related projects.

另一种消息传递解决方案是 JoCaml ,它开创了新型的并发通信方式,称为加入微积分.请注意,它与OCaml编译器二进制兼容.

another message-passing solution is JoCaml, pioneering new style of concurrent communications known as join calculus. Note that it is binary-compatible with OCaml compilers.

并不能防止GC可以并行运行的运行时的混乱,但是:请参见

that did not prevent the confection of a runtime whose GC is ok with parallelism, though: see a discussion of OCAML4MC in this other issue of the CWN.

还有:

  • Netmulticore - multi-processing sharing ocaml values via mapped shared memory.

CamlP3l -Caml并行程序的编译器.

CamlP3l - compiler for Caml parallel programs.

OCaml-Java -发出Java字节码的OCaml编译器

OCaml-Java - an OCaml compiler that emits Java bytecode

我没有关注有关Ocaml& amp;的最新讨论.但是,并行编程. 我要离开此 CW ,以便其他人可以更新我的内容.如果此问题能够达到与

I haven't followed more recent discussions about Ocaml & parallel programming, though. I'm leaving this CW so that others can update what I mention. It would be great if this question could reach the same level of completeness as the analogous one for Haskell.

这篇关于OCaml并行化能力的状态如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆