4 ms·
Are other forms of concurrency still available? This has always seemed like a strange limitation. Most of the code that I write doesn't require me to spin up to
by mjt0229 13y ago
Are other forms of concurrency still available? This has always seemed like a strange limitation. Most of the code that I write doesn't require me to spin up tons of threads (at least, not in my code), but sometimes it's really helpful to have them.
- edwintorok 13y agoYes: * multiple processes (there are a few libraries that can help make it easier) * I/O concurrency with cooperative threads library: Equeue, Lwt or Async * you could also use the built-in Thread module for I/O concurrency but the overhead will likely be higher * you can execute C code in multiple threads in parallel, only OCaml code is limited to a single thread (due to the global lock)
- emmelaich 13y agoWhat are those libraries for multiple processes under Ocaml? I could google but I'm fishing for your recommendations as well.
- edwintorok 13y agoFunctory, OCamlMPI and Netmulticore (part of OCamlNet). I haven't actually used any of them though, I'm quite happy with Lwt for now.