package moonpool
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=0f3d42753c2636a6a55427af89d2574b08a29c32100f2002ae3e47f6e4d23ff1
sha512=7fa651570493ddd7c594eb46b76782610da6a6823e5178c2b20ceafe2f159649caedaac01e975428605de865d3dff9008a798090cec77c909477a86c04532709
doc/moonpool.dpool/Moonpool_dpool/index.html
Module Moonpool_dpoolSource
Static pool of domains.
These domains are shared between all the pools in moonpool. The rationale is that we should not have more domains than cores, so it's easier to reserve exactly that many domain slots, and run more flexible thread pools on top (each domain being shared by potentially multiple threads from multiple pools).
The pool should not contain actual domains if it's not in use, ie if no runner is presently actively using one or more of the domain slots.
NOTE: Interface is still experimental.
Number of domains in the pool when all domains are active.
Low level interface for resouce handling
Be very cautious with this interface, or resource leaks might occur.
run_on i f runs f() on the domain with index i. Precondition: 0 <= i < n_domains(). The thread must call decr_on with i once it's done.
Signal that a thread is stopping on the domain with index i.
run_on_and_wait i f runs f() on the domain with index i, and blocks until the result of f() is returned back.