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:
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:
* compilation with frame pointers
* AFL support
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.
21 December 2021 19:31
Corresponding tweet for this thread:
Share link for this tweet.
Been waiting for this so so so so long! So excited!
Effect Handlers in OCaml is even such a larger thing than just multicore too!! But even then it’s such a
brilliant way to setup multicore. I just hope it’s not too late for OCaml’s relevance in the wider view at this point…