Module IBase__ProcessPool

module TaskGenerator : sig ... end
type (_, _, _) t

A ('work, 'final) t process 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.

val create : jobs:int -> child_prologue:(unit -> unit) -> f:('work -> 'result option) -> child_epilogue:(unit -> 'final) -> tasks:(unit -> ('work'result) TaskGenerator.t) -> ('work'final'result) t

Create a new pool of processes running jobs jobs in parallel

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

use the processes in the given process pool to run all the given tasks in parallel and return the results of the epilogues