Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
696 views
in Technique[技术] by (71.8m points)

parallel processing - What is the state of OCaml's parallelization abilities?

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?

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

Thanks!

question from:https://stackoverflow.com/questions/6588500/what-is-the-state-of-ocamls-parallelization-abilities

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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:

    (...) 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

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

  • 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.

  • 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.

  • 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.

There is also:

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

  • CamlP3l - compiler for Caml parallel programs.

  • OCaml-Java - an OCaml compiler that emits Java bytecode


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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...