### setup_pool Source: https://ocaml-multicore.github.io/domainslib/doc/domainslib/Domainslib/Task/index.html Sets up a task execution pool with a specified number of domains. ```APIDOC ## setup_pool ### Description Sets up a task execution pool with `num_domains` new domains. If `name` is provided, the pool is mapped to `name` which can be looked up later with `lookup_pool`. ### Parameters - **num_domains** (int) - Required - Number of domains to create. - **name** (string) - Optional - Name to associate with the pool. ``` -------------------------------- ### run Source: https://ocaml-multicore.github.io/domainslib/doc/domainslib/Domainslib/Task/index.html Runs a task synchronously within a pool. ```APIDOC ## run ### Description Runs the task `t` synchronously with the calling domain and the domains in the pool `p`. This function must be used at the top level to enclose calls to functions that await on promises. ``` -------------------------------- ### make_bounded Source: https://ocaml-multicore.github.io/domainslib/doc/domainslib/Domainslib/Chan/index.html Creates a bounded channel with a specified buffer size. If the size is 0, the operation is synchronous; if 1, it acts as an MVar. ```APIDOC ## val make_bounded : int -> 'a t ### Description Creates a bounded channel with a buffer of size n. Raises Invalid_argument if n < 0. ### Parameters - **n** (int) - Required - The size of the channel buffer. ``` -------------------------------- ### make_unbounded Source: https://ocaml-multicore.github.io/domainslib/doc/domainslib/Domainslib/Chan/index.html Creates an unbounded channel. ```APIDOC ## val make_unbounded : unit -> 'a t ### Description Returns a new unbounded channel. ``` -------------------------------- ### send Source: https://ocaml-multicore.github.io/domainslib/doc/domainslib/Domainslib/Chan/index.html Sends a value over a channel, blocking if the buffer is full. ```APIDOC ## val send : 'a t -> 'a -> unit ### Description Sends the value v over the channel c. Blocks if the channel buffer is full. ``` -------------------------------- ### parallel_for Source: https://ocaml-multicore.github.io/domainslib/doc/domainslib/Domainslib/Task/index.html Executes a for loop in parallel. ```APIDOC ## parallel_for ### Description Behaves similar to a standard for loop but runs iterations in parallel across the pool. Must be called within a `run` scope. ``` -------------------------------- ### recv Source: https://ocaml-multicore.github.io/domainslib/doc/domainslib/Domainslib/Chan/index.html Receives a value from a channel, blocking if empty. ```APIDOC ## val recv : 'a t -> 'a ### Description Returns a value received over the channel c. Blocks if the channel buffer is empty. ``` -------------------------------- ### recv_poll Source: https://ocaml-multicore.github.io/domainslib/doc/domainslib/Domainslib/Chan/index.html Attempts to receive a value from a channel without blocking. ```APIDOC ## val recv_poll : 'a t -> 'a option ### Description Attempts to receive a message on channel c. Returns Some v if available, otherwise None. ``` -------------------------------- ### send_poll Source: https://ocaml-multicore.github.io/domainslib/doc/domainslib/Domainslib/Chan/index.html Attempts to send a value over a channel without blocking. ```APIDOC ## val send_poll : 'a t -> 'a -> bool ### Description Attempts to send value v over channel c. Returns true if successful, false if the buffer is full. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.