# Multicore OCaml: October 2020

**URL:** <https://discuss.ocaml.org/t/multicore-ocaml-october-2020/6729>\
**Category:** Community\
**Tags:** multicore, multicore-monthly\
**Created:** [November 9, 2020, 8:44am UTC](https://discuss.ocaml.org/t/multicore-ocaml-october-2020/6729 "2020-11-09T08:44:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![avsm](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/avsm/32/6_2.png) [@avsm](https://discuss.ocaml.org/u/avsm)\
**Post date:** [November 9, 2020, 8:44am UTC](https://discuss.ocaml.org/t/multicore-ocaml-october-2020/6729/1 "2020-11-09T08:44:46Z")

</div>

Welcome to the October 2020 multicore OCaml report, compiled by @shakthimaan, @kayceesrk and of course myself. The [previous monthly ([https://discuss.ocaml.org/tag/multicore-monthly](https://discuss.ocaml.org/tag/multicore-monthly)) updates are also available for your perusal.

**OCaml 4.12.0-dev:** The upstream OCaml tree has been branched for the 4.12 release, and the [OCaml readiness team](https://github.com/ocaml/opam-repository/issues/17530) is busy stabilising it with the ecosystem. The 4.12.0 development stream has significant progress towards multicore support, especially with the runtime handling of naked pointers. The release will ship with a dynamic checker for naked pointers that you can use to verify that your own codebase is clean of them, as this will be a prerequisite for OCaml 5.0 and multicore compatibility. This is activated via the `--enable-naked-pointers-checker` configure option.

**Convergence with upstream and multicore trees:** The multicore OCaml trees have seen significant robustness improvements as we’ve converged our trees with upstream OCaml (possible now that the upstream architectural changes are synched with the requirements of multicore). In particular, the handling of global C roots is much better in multicore now as it uses the upstream OCaml scheme, and the GC colour scheme also exactly matches upstream OCaml’s. This means that community libraries from `opam` work increasingly well when built with multicore OCaml (using the `no-effects-syntax` branch).

**Features:** Multicore OCaml is also using domain local allocation buffers now to simplify its internals. We are also now working on benchmarking the IO subsystem, and support for CPU parallelism for the Lwt concurrency library has been added, as well as refreshing the new Asynchronous Effect-based IO ([aeio](https://github.com/kayceesrk/ocaml-aeio)) with Multicore OCaml, Lwt, and httpaf in an [http-effects](https://github.com/sadiqj/http-effects) library.

**Benchmarking:** The Sandmark benchmarking test suite has additional configuration options, and there are new proposals in that project to leverage as much of the OCaml tools and ecosystem as much as possible.

As with previous updates, the Multicore OCaml ongoing, and completed tasks are listed first, which are followed by improvements to the Sandmark benchmarking test suite. Finally, the upstream OCaml related work is mentioned for your reference.

## Multicore OCaml

### Ongoing

- [ocaml-multicore/ocaml-multicore#422](https://github.com/ocaml-multicore/ocaml-multicore/pull/422)  
Simplify minor heaps configuration logic and masking

- [ocaml-multicore/ocaml-multicore#426](https://github.com/ocaml-multicore/ocaml-multicore/pull/426)  
Replace global roots implementation

- [ocaml-multicore/ocaml-multiore#427](https://github.com/ocaml-multicore/ocaml-multicore/pull/427)  
Garbage Collector colours change backport

- [ocaml-multicore/ocaml-multicore#429](https://github.com/ocaml-multicore/ocaml-multicore/pull/429)  
Fix a STW interrupt race

### Completed

#### Systhreads support

- [ocaml-multicore/ocaml-multicore#381](https://github.com/ocaml-multicore/ocaml-multicore/pull/381)  
Reimplementing Systhreads with pthreads (Domain execution contexts)

- [ocaml-multicore/ocaml-multicore#410](https://github.com/ocaml-multicore/ocaml-multicore/pull/410)  
systhreads: `caml_c_thread_register` and `caml_c_thread_unregister`

#### Domain Local Storage

- [ocaml-multicore/ocaml-multicore#404](https://github.com/ocaml-multicore/ocaml-multicore/pull/404)  
Domain.DLS.new\_key takes an initialiser

- [ocaml-multicore/ocaml-multicore#405](https://github.com/ocaml-multicore/ocaml-multicore/pull/405)  
Rework Domain.DLS.get search function such that it no longer allocates

#### Lwt

- [ocaml-multicore/multicore-opam#33](https://github.com/ocaml-multicore/multicore-opam/pull/33)  
Add lwt.5.3.0+multicore

- The [Asynchronous Effect-based IO](https://github.com/kayceesrk/ocaml-aeio) builds with a recent  
Lwt, and the HTTP effects demo has been updated to work with  
Multicore OCaml, Lwt, and httpaf. The demo source code is available  
at the [http-effects](https://github.com/sadiqj/http-effects) repo.

#### Sundries

- [ocaml-multicore/ocaml-multicore#406](https://github.com/ocaml-multicore/ocaml-multicore/pull/406)  
Remove ephemeron usage of RPC

- [ocaml-multicore/ocaml-multicore#411](https://github.com/ocaml-multicore/ocaml-multicore/pull/411)  
Fix typo for presume and presume\_arg in `internal_variable_names`

- [ocaml-multicore/ocaml-multicore#414](https://github.com/ocaml-multicore/ocaml-multicore/pull/414)  
Fix up `Ppoll` `semantics_of_primitives` entry

- [ocaml-multicore/ocaml-multicore#416](https://github.com/ocaml-multicore/ocaml-multicore/pull/416)  
Fix callback effect bug

## Benchmarking

### Ongoing

#### Configuration

- [ocaml-bench/ocaml-bench-scripts#12](https://github.com/ocaml-bench/ocaml_bench_scripts/pull/12)  
Add support for parallel multibench targets and JSON input

- [ocaml-bench/sandmark#180](https://github.com/ocaml-bench/sandmark/issues/180)  
Notebook Refactoring and User changes

- [ocaml-bench/sandmark#189](https://github.com/ocaml-bench/sandmark/pull/189)  
Add environment support for wrapper in JSON configuration file

#### Proposals

- [ocaml-bench/sandmark#159](https://github.com/ocaml-bench/sandmark/issues/159)  
Implement a better way to describe tasklet cpulist

- [ocaml-bench/sandmark#179](https://github.com/ocaml-bench/sandmark/issues/179)  
[RFC] Classifying benchmarks based on running time

- We are exploring the use of `opam-compiler` switch environment to  
build the Sandmark benchmark test suite. The merge of [systhreads  
compatibility  
support](https://github.com/ocaml-multicore/ocaml-multicore/pull/407)  
now enables us to install dune natively inside the switch  
environment, along with the other benchmarks. With this approach, we  
hope to modularize our benchmarking test suite, and converge to  
fully using the OCaml tools and ecosystem.

#### Sundries

- [ocaml-bench/sandmark#181](https://github.com/ocaml-bench/sandmark/pull/181)  
Lock-free map bench

- [ocaml-bench/sandmark#183](https://github.com/ocaml-bench/sandmark/pull/183)  
Use crout\_decomposition name for numerical analysis benchmark

### Completed

- [ocaml-bench/sandmark#177](https://github.com/ocaml-bench/sandmark/pull/177)  
Display raw baseline numbers in normalized graphs

 ![PR 177 Image](https://us1.discourse-cdn.com/flex020/uploads/ocaml/original/2X/0/08df45ac1d5de2415b7735cf7b2006fb21a1365a.png)

- [ocaml-bench/sandmark#178](https://github.com/ocaml-bench/sandmark/pull/178)  
Change to new Domain.DLS API with Initializer

- [ocaml-bench/sandmark#185](https://github.com/ocaml-bench/sandmark/pull/185)  
Clean up existing effect benchmarks

- [ocaml-bench/sandmark#186](https://github.com/ocaml-bench/sandmark/pull/186)  
Very simple effect microbenchmarks to cover code paths

- [ocaml-bench/sandmark#187](https://github.com/ocaml-bench/sandmark/pull/187)  
Implementation of ‘recursion’ benchmarks for effects

## OCaml

### Ongoing

- [ocaml/ocaml#9876](https://github.com/ocaml/ocaml/pull/9876)  
Do not cache young\_limit in a processor register

- [ocaml/ocaml#9934](https://github.com/ocaml/ocaml/pull/9934)  
Prefetching optimisations for sweeping

### Completed

- [ocaml/ocaml#9947](https://github.com/ocaml/ocaml/pull/9947)  
Add a naked pointers dynamic checker

- [ocaml/ocaml#9951](https://github.com/ocaml/ocaml/pull/9951/)  
Ensure that the mark stack push optimisation handles naked pointers

We would like to thank all the OCaml users and developers in the community for their continued support, reviews and contribution to the project.

## Acronyms

- AEIO: Asynchronous Effect-based IO
- API: Application Programming Interface
- ARM: Advanced RISC Machine
- CPU: Central Processing Unit
- DEC: Domain Execution Context
- DLS: Domain Local Storage
- GC: Garbage Collector
- HTTP: Hypertext Transfer Protocol
- JSON: JavaScript Object Notation
- NUMA: Non-Uniform Memory Access
- OPAM: OCaml Package Manager
- OS: Operating System
- PR: Pull Request
- RISC-V: Reduced Instruction Set Computing - V
- RPC: Remote Procedure Call
- STW: Stop-The-World

---

<div class="post-metadata">

**Author:** ![Chimrod](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/chimrod/32/6042_2.png) [@Chimrod](https://discuss.ocaml.org/u/Chimrod)\
**Post date:** [November 10, 2020, 8:14am UTC](https://discuss.ocaml.org/t/multicore-ocaml-october-2020/6729/2 "2020-11-10T08:14:00Z")

</div>

I am not able to understand all the points, and see how huge the work you do for all the changes mentionned, but I really appreciate the communication effort, and how you synthesis for this task in a comprehensible way.

Your monthly repports helps to understand how works the inclusion for a such change, and the communication to the community is a great plus.

So thank you for both the work, and the reports 🙂
