module Domain: Domaintype 'a t
A domain of type 'a t runs independently, eventually producing a
result of type 'a, or an exception
val spawn : (unit -> 'a) -> 'a tspawn f creates a new domain that runs in parallel with the
current domain.
val join : 'a t -> 'ajoin d blocks until domain d runs to completion. If d results in a
value, then that is returned by join d. If d raises an uncaught
exception, then that is re-raised by join d.
typeid = privateint
Domains have unique integer identifiers
val get_id : 'a t -> idget_id d returns the identifier of the domain d
val self : unit -> idself () is the identifier of the currently running domain
val at_first_spawn : (unit -> unit) -> unitRegister the given function to be called before any domain is
spawned (except the initial domain) and before any function registered
with Domain.at_startup is called. The functions registered with
at_first_spawn are called in 'last in, first out' order: the function
most recently added with at_first_spawn is called first.
Invalid_argument if the first domain has already been spawned.val at_exit : (unit -> unit) -> unitRegister the given function to be called at when a spawned domain exits.
This function is also registered with at_exit. If the registered
function raises an exception, the exceptions are ignored. The registered
functions are called in 'last in, first out' order: the function most
recently added with at_exit is called first.
val at_startup : (unit -> unit) -> unitRegister the given function to be called when a domain starts. This
function is called before the callback specified to spawn f is
executed. The registered functions are called in 'last in, first out'
order: the function most recently added with at_startup is
called first.
val cpu_relax : unit -> unitIf busy-waiting, calling cpu_relax () between iterations will improve performance on some CPU architectures
val set_name : string -> unitset_name s set the domain's thread name to s. s should not be longer
than 15 characters. If s is longer than 15 characters,
raise Invalid_argument.
val is_main_domain : unit -> boolis_main_domain () returns true if called from the initial domain.
module DLS:sig..end