package eio

  1. Overview
  2. Docs

Parallel computation across multiple CPU cores.

class virtual t : object ... end
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.