Multicore OCaml by kayceesrk · Pull Request #10831 · ocaml/ocaml.
This PR adds support for shared-memory parallelism through domains and direct-style concurrency through effect handlers (without syntactic support). It intends to have backwards compatibility - in …
Read in full here:
ocaml:trunk
← ocaml-multicore:multicore-pr
opened 03:13PM - 21 Dec 21 UTC
This PR adds support for shared-memory parallelism through domains and direct-st… yle concurrency through effect handlers (without syntactic support). It intends to have backwards compatibility in terms of language features, C API, and also the performance of single-threaded code.
## For users
If you want to learn more about Multicore OCaml, please have a look at the [multicore wiki](https://github.com/ocaml-multicore/ocaml-multicore/wiki) for papers, talks, tutorials and blog posts.
If you are interested in using Multicore OCaml, we suggest having a look at the following work-in-progress libraries:
1. [domainslib](https://github.com/ocaml-multicore/domainslib) -- a library for nested task parallelism
2. [eio](https://github.com/ocaml-multicore/eio) -- asynchronous io in direct-style
Here is a snapshot of the multicore scalability results on parallel benchmarks from [sandmark](https://github.com/ocaml-bench/sandmark) on a 2 processor AMD EPYC 7551 server with 64 cores in total:

The number in the parenthesis next to the benchmark name is the time (in seconds) taken by the sequential baseline of the corresponding benchmark.
## Review process
This PR comes at the back of asynchronous code reviews by the OCaml core developers followed by a week-long synchronous code review session. The summary of the discussions is available in the [November multicore monthly](https://discuss.ocaml.org/t/multicore-ocaml-november-2021-with-results-of-code-review/8934/5#core-team-code-review-1).
As mentioned in the November multicore monthly, this PR constitutes the minimum viable product (MVP) for Multicore OCaml. The "pre-MVP" tasks have been completed, and the "post-MVP for 5.00" tasks are yet to be done. The aim is that these tasks, and the ones that follow, can be completed on ocaml/ocaml Github repo, through the usual OCaml PR review process rather than on the Multicore OCaml repo.
Given that the PR is quite large, if you spot major breakages and functionality gaps, we suggest that you make separate issues on ocaml/ocaml Github repo. This will help keep the discussion threads readable. Feel free to comment on minor issues (typos, formatting edits, etc) directly in this PR, and we shall be happy to fix those.
## What's in the box
The only supported backend is `amd64` on Linux and macOS; `arm64` is in the works. The following features are not implemented:
* statmemprof
* compilation with frame pointers
* ocamldebug
* AFL support
* flambda
## Acknowledgements
Multicore OCaml has been a long running project. We would like to thank all those who have helped find issues, debugged issues, reviewed code and contributed code along the way.
-- The Multicore OCaml team
This thread was posted by one of our members via one of our news source trackers.
2 Likes