Comprehensive developer doc for multicore base modules

Hi there!

Do y’all know of any comprehensive developper-oriented documentation of the base multicore modules?

With OCaml 5 coming up with multicore support, I’m trying to anticipate and see how much of this scheduling library we use can be switched from Thread, Mutex and Conditions to Domain and Atomic

So far I have only been able to find this and information based on source code, .mli and the implementations in domainsLib and both are pretty sparse at the moment…

I know that there might be slides or videos floating around but, call me old fashioned, I like a good old text documentation.

Thanks for any pointer!

2 Likes

I hope I’m not hijacking this thread too much if I add my question: What is the preferred compiler switch to experiment with multicore? 4.12+domains? Will this be rebased to 4.13 or 4.14 before 5.0?

Hi @toots! The tutorial focuses more on Domainslib, not the base modules such as Domain or Atomic. This is because, we don’t expect these modules to be used frequently in user applications. If there are specific questions or clarifications, feel free to create an issue in the corresponding issue tracker. Any feedback to improve the docs will be useful too!

@n4323 Sure you can experiment with 4.12.0+domains. It is already rebased to trunk, 5.00 preview branch is available here. Feel free to give that a shot.

Thanks for the response @sudha. We’ve been using this scheduling library for years and it already provides a good API for developers.

DomainsLib is already pretty opinionated and our library is already low-level. Each queue currently runs in its own Thread so, it makes sense to wonder if running it inside a Domain would be the way to adapt them to multicore.

I am happy to provide feedback about the docs but, first, it would be good to know where to look at… :sweat_smile:

Lastly, if Domain and Atomic are not meant for general-use I would question having them in the Stdlib at all. It is usual routine for any developper to scout the standard library for modules that could be of help for their projects. Lower level OCaml modules are usually a little more buried under the hood.

1 Like