Eio.Domain_manager
Parallel computation across multiple CPU cores.
type 'a t = [> ty ] as 'a Resource.t
val run : _ t -> (unit -> 'a) -> 'a
run t f
runs f ()
in a newly-created domain and returns the result.
Other fibers in the calling domain can run in parallel with the new domain.
Warning: f
must only access thread-safe values from the calling domain, but this is not enforced by the type system.
If the calling fiber is cancelled, this is propagated to the spawned domain.
val run_raw : _ t -> (unit -> 'a) -> 'a
run_raw t f
is like run
, but does not run an event loop in the new domain, and so cannot perform IO, fork fibers, etc.
module Pi : sig ... end