Awesome Open Source
Awesome Open Source

Multicore OCaml

A concurrent and shared-memory parallel extension of the OCaml compiler.

Multicore OCaml cleanly separates abstractions for concurrency (overlapped execution) from parallelism (simultaneous execution). Concurrency is expressed through effect handlers and parallelism through domains. Much of the work in supporting shared memory parallelism is the development of a mostly-concurrent, generational, mark-and-sweep collector that strikes a balance between single-threaded performance and feature backwards compatibility, and multicore scalability.

See the wiki for more resources.


Active variants

  • 4.12+domains+effects (default) -- A variant based on 4.12 that performs stop-the-world parallel minor collection. It makes available domains and the syntax extensions for using effects. The branch is 4.12+domains+effects.
  • 4.12+domains -- This branch has domains but does not have the syntax extension for effects (it retains the compiler and runtime system changes needed for effects). The branch is 4.12+domains. This branch is useful to install ppx libraries.

Historical variants

  • Parallel Minor GC (4.10) -- A 4.10 branch using a stop-the-world parallel minor collection. The branch is parallel_minor_gc.
  • Parallel Minor GC + No effect syntax (4.10) -- A 4.10 branch using a stop-the-world parallel minor collection but without the syntax extension for effects. The branch is no-effect-syntax.
  • Parallel Minor GC (4.06) -- A 4.06 branch using a stop-the-world parallel minor collection. The branch is parallel_minor_gc_4_06.
  • Concurrent Minor GC (4.06) -- A 4.06 branch that collects each domain's minor heap concurrently. The branch is master.


If you want to try out Multicore OCaml, the easiest way is to install the compiler using OPAM.

Parallel programming examples are available in the domainslib library.

Effect handler (concurrent programming) examples are available in effects-examples repo.


The original README.adoc file has been moved to README.stock.adoc.

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Ocaml (8,495
Concurrency (1,297
Related Projects