Module IBase.DomainPool

Pool 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.

type (_, _, _) t

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 ... end
val 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) t

Create a new pool of domains running jobs jobs in parallel

val run : (_, 'final, _) t -> 'final option IStdlib.IStd.Array.t

use the domains in the given domain pool to run all the given tasks in parallel and return the results of the epilogues