domainslib
domainslib copied to clipboard
Provide a way to iterate over all the pools
It will be useful to have a way to iterate over all the pools that are created in domainslib. One use case is to teardown all the pools. But there may be others (stats?). See relevant discussion at https://github.com/ocaml-multicore/domainslib/pull/45#issuecomment-930224410.
The data structure to use for this would be the Weak hash set https://ocaml.org/api/Weak.html#1_Weakhashsets, which will hold a weak pointer to the pools.