Is it time to start rethinking concurrency in OCaml?
I have followed the argumentation of only using one native thread for the OCaml runtime. I can easily see how this can increase performance and simplify implementation. I can also see that spawning new processes makes sense, so you get a local heap for each task.
However, as we move forward it seems that we will get more than a few cores on the same computational node according to the following article:
As I see it, it is not feasible to spawn a new process with a local heap for each core, when the number of cores increases dramatically.
I am not sure that a parallel GC is a sufficient solution either due to the high contention on memory, at least unless it provide some additional core affinity features. I believe some level of compiler support is needed in the not so distant future such that enough primitives are available to build powerful multi-core aware libraries. One approach could be micro heaps with core affinity and handle mutable memory specially.