Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Multicore OCaml

Leo White edited this page Sep 10, 2013 · 16 revisions

Git branch: multicore

This project aims to add support for executing multiple threads of OCaml code in parallel within the same process. There are two sides to this project:

  1. Creating a multicore OCaml runtime.
  2. Creating programming models and libraries to support parallel programming in OCaml.

Multicore runtime

The basic idea of this runtime is to allow multiple OCaml runtimes (called contexts) to exist in the same process, and then to add a shared heap for objects that can be accessed by multiple contexts.

See Multicore runtime for a more detailed discussion.

Status

We are able to create multiple OCaml contexts within a single process. In byte-code, the read and write barriers have been updated and successfully promote objects to the shared heap. Objects on the shared heap are not currently collected.

Things to be done

Add read barrier to native code output

We need to add read barrier into the output from ocamlopt for mutable reads. This should be triggered with some kind of "-multicore" command-line option.

Add proxy objects

We need to add [proxy objects](Multicore runtime#proxy-objects).

Add a garbage collector to the shared heap

We need to add a garbage collector to the shared heap.

Parallel programming models