IBase.DomainPoolPool of domain workers that can both receive tasks from the orchestrator process and start doing tasks on their own. A shared concurrent queue is used for updates from workers and a concurrent queue per worker is used for sending commands to the worker.
See also ProcessPool.
A ('work, 'final) t domain pool accepts tasks of type 'work and produces an array of results of type 'final. 'work and 'final will be marshalled over a Unix pipe.
module Worker : sig ... endval create :
jobs:int ->
child_prologue:(Worker.id -> unit) ->
f:('work -> 'result option) ->
child_epilogue:(Worker.id -> 'final) ->
tasks:(unit -> ('work, 'result, WorkerPoolState.worker_id) TaskGenerator.t) ->
('work, 'final, 'result) tCreate a new pool of domains running jobs jobs in parallel
val run : (_, 'final, _) t -> 'final option IStdlib.IStd.Array.tuse the domains in the given domain pool to run all the given tasks in parallel and return the results of the epilogues