diff --git a/dev/either/Either/index.html b/dev/either/Either/index.html index d04a2724..d2cb1826 100644 --- a/dev/either/Either/index.html +++ b/dev/either/Either/index.html @@ -1,5 +1,5 @@ -Either (either.Either)

Module Either

type ('a, 'b) t = ('a, 'b) Stdlib.Either.t =
  1. | Left of 'a
  2. | Right of 'b

This module defines the common Either interface that is provided for all OCaml versions. For documentation of these functions, refer to the standard library.

val left : 'a -> ('a, 'b) t
val right : 'b -> ('a, 'b) t
val is_left : ('a, 'b) t -> bool
val is_right : ('a, 'b) t -> bool
val find_left : ('a, 'b) t -> 'a option
val find_right : ('a, 'b) t -> 'b option
val map_left : ('a1 -> 'a2) -> ('a1, 'b) t -> ('a2, 'b) t
val map_right : ('b1 -> 'b2) -> ('a, 'b1) t -> ('a, 'b2) t
val map : +Either (either.Either)

Module Either

type ('a, 'b) t = ('a, 'b) Stdlib.Either.t =
  1. | Left of 'a
  2. | Right of 'b

This module defines the common Either interface that is provided for all OCaml versions. For documentation of these functions, refer to the standard library.

val left : 'a -> ('a, 'b) t
val right : 'b -> ('a, 'b) t
val is_left : ('a, 'b) t -> bool
val is_right : ('a, 'b) t -> bool
val find_left : ('a, 'b) t -> 'a option
val find_right : ('a, 'b) t -> 'b option
val map_left : ('a1 -> 'a2) -> ('a1, 'b) t -> ('a2, 'b) t
val map_right : ('b1 -> 'b2) -> ('a, 'b1) t -> ('a, 'b2) t
val map : left:('a1 -> 'a2) -> right:('b1 -> 'b2) -> ('a1, 'b1) t -> diff --git a/dev/either/Either__/index.html b/dev/either/Either__/index.html new file mode 100644 index 00000000..206cdd88 --- /dev/null +++ b/dev/either/Either__/index.html @@ -0,0 +1,2 @@ + +Either__ (either.Either__)

Module Either__

This module is hidden.

diff --git a/dev/either/Either__Either_intf/index.html b/dev/either/Either__Either_intf/index.html new file mode 100644 index 00000000..70937af3 --- /dev/null +++ b/dev/either/Either__Either_intf/index.html @@ -0,0 +1,2 @@ + +Either__Either_intf (either.Either__Either_intf)

Module Either__Either_intf

This module is hidden.

diff --git a/dev/either/index.html b/dev/either/index.html index 41521aea..c31c433f 100644 --- a/dev/either/index.html +++ b/dev/either/index.html @@ -1,2 +1,2 @@ -index (either.index)

Package either

Package info

changes-files
license-files
readme-files
+index (either.index)

Package either

Package info

changes-files
license-files
readme-files
diff --git a/dev/moonpool/Moonpool/Atomic/index.html b/dev/moonpool/Moonpool/Atomic/index.html index 5f1f34ce..31fe9ab2 100644 --- a/dev/moonpool/Moonpool/Atomic/index.html +++ b/dev/moonpool/Moonpool/Atomic/index.html @@ -1,2 +1,2 @@ -Atomic (moonpool.Moonpool.Atomic)

Module Moonpool.Atomic

Atomic values.

This is either a shim using ref, on pre-OCaml 5, or the standard Atomic module on OCaml 5.

include module type of struct include Stdlib.Atomic end
type !'a t = 'a Stdlib.Atomic.t

An atomic (mutable) reference to a value of type 'a.

val make : 'a -> 'a t

Create an atomic reference.

val get : 'a t -> 'a

Get the current value of the atomic reference.

val set : 'a t -> 'a -> unit

Set a new value for the atomic reference.

val exchange : 'a t -> 'a -> 'a

Set a new value for the atomic reference, and return the current value.

val compare_and_set : 'a t -> 'a -> 'a -> bool

compare_and_set r seen v sets the new value of r to v only if its current value is physically equal to seen -- the comparison and the set occur atomically. Returns true if the comparison succeeded (so the set happened) and false otherwise.

val fetch_and_add : int t -> int -> int

fetch_and_add r n atomically increments the value of r by n, and returns the current value (before the increment).

val incr : int t -> unit

incr r atomically increments the value of r by 1.

val decr : int t -> unit

decr r atomically decrements the value of r by 1.

+Atomic (moonpool.Moonpool.Atomic)

Module Moonpool.Atomic

Atomic values.

This is either a shim using ref, on pre-OCaml 5, or the standard Atomic module on OCaml 5.

include module type of struct include Stdlib.Atomic end
type !'a t = 'a Stdlib.Atomic.t

An atomic (mutable) reference to a value of type 'a.

val make : 'a -> 'a t

Create an atomic reference.

val get : 'a t -> 'a

Get the current value of the atomic reference.

val set : 'a t -> 'a -> unit

Set a new value for the atomic reference.

val exchange : 'a t -> 'a -> 'a

Set a new value for the atomic reference, and return the current value.

val compare_and_set : 'a t -> 'a -> 'a -> bool

compare_and_set r seen v sets the new value of r to v only if its current value is physically equal to seen -- the comparison and the set occur atomically. Returns true if the comparison succeeded (so the set happened) and false otherwise.

val fetch_and_add : int t -> int -> int

fetch_and_add r n atomically increments the value of r by n, and returns the current value (before the increment).

val incr : int t -> unit

incr r atomically increments the value of r by 1.

val decr : int t -> unit

decr r atomically decrements the value of r by 1.

diff --git a/dev/moonpool/Moonpool/Blocking_queue/index.html b/dev/moonpool/Moonpool/Blocking_queue/index.html index f521b67c..ca05e447 100644 --- a/dev/moonpool/Moonpool/Blocking_queue/index.html +++ b/dev/moonpool/Moonpool/Blocking_queue/index.html @@ -1,5 +1,5 @@ -Blocking_queue (moonpool.Moonpool.Blocking_queue)

Module Moonpool.Blocking_queue

A simple blocking queue.

This queue is quite basic and will not behave well under heavy contention. However, it can be sufficient for many practical use cases.

NOTE: this queue will typically block the caller thread in case the operation (push/pop) cannot proceed. Be wary of deadlocks when using the queue from a pool when you expect the other end to also be produced/consumed from the same pool.

See discussion on Fut.wait_block for more details on deadlocks and how to mitigate the risk of running into them.

More scalable queues can be found in Lockfree (https://github.com/ocaml-multicore/lockfree/)

type 'a t

Unbounded blocking queue.

This queue is thread-safe and will block when calling pop on it when it's empty.

val create : unit -> _ t

Create a new unbounded queue.

val size : _ t -> int

Number of items currently in the queue. Note that pop might still block if this returns a non-zero number, since another thread might have consumed the items in the mean time.

  • since 0.2
exception Closed
val push : 'a t -> 'a -> unit

push q x pushes x into q, and returns ().

In the current implementation, push q will never block for a long time, it will only block while waiting for a lock so it can push the element.

  • raises Closed

    if the queue is closed (by a previous call to close q)

val pop : 'a t -> 'a

pop q pops the next element in q. It might block until an element comes.

  • raises Closed

    if the queue was closed before a new element was available.

val close : _ t -> unit

Close the queue, meaning there won't be any more push allowed, ie push will raise Closed.

pop will keep working and will return the elements present in the queue, until it's entirely drained; then pop will also raise Closed.

val try_pop : force_lock:bool -> 'a t -> 'a option

try_pop q immediately pops the first element of q, if any, or returns None without blocking.

  • parameter force_lock

    if true, use Mutex.lock (which can block under contention); if false, use Mutex.try_lock, which might return None even in presence of an element if there's contention

val try_push : 'a t -> 'a -> bool

try_push q x tries to push into q, in which case it returns true; or it fails to push and returns false without blocking.

  • raises Closed

    if the locking succeeded but the queue is closed.

val transfer : 'a t -> 'a Stdlib.Queue.t -> unit

transfer bq q2 transfers all items presently in bq into q2 in one atomic section, and clears bq. It blocks if no element is in bq.

This is useful to consume elements from the queue in batch. Create a Queue.t locally:

let dowork (work_queue: job Bb_queue.t) =
+Blocking_queue (moonpool.Moonpool.Blocking_queue)

Module Moonpool.Blocking_queue

A simple blocking queue.

This queue is quite basic and will not behave well under heavy contention. However, it can be sufficient for many practical use cases.

NOTE: this queue will typically block the caller thread in case the operation (push/pop) cannot proceed. Be wary of deadlocks when using the queue from a pool when you expect the other end to also be produced/consumed from the same pool.

See discussion on Fut.wait_block for more details on deadlocks and how to mitigate the risk of running into them.

More scalable queues can be found in Lockfree (https://github.com/ocaml-multicore/lockfree/)

type 'a t

Unbounded blocking queue.

This queue is thread-safe and will block when calling pop on it when it's empty.

val create : unit -> _ t

Create a new unbounded queue.

val size : _ t -> int

Number of items currently in the queue. Note that pop might still block if this returns a non-zero number, since another thread might have consumed the items in the mean time.

  • since 0.2
exception Closed
val push : 'a t -> 'a -> unit

push q x pushes x into q, and returns ().

In the current implementation, push q will never block for a long time, it will only block while waiting for a lock so it can push the element.

  • raises Closed

    if the queue is closed (by a previous call to close q)

val pop : 'a t -> 'a

pop q pops the next element in q. It might block until an element comes.

  • raises Closed

    if the queue was closed before a new element was available.

val close : _ t -> unit

Close the queue, meaning there won't be any more push allowed, ie push will raise Closed.

pop will keep working and will return the elements present in the queue, until it's entirely drained; then pop will also raise Closed.

val try_pop : force_lock:bool -> 'a t -> 'a option

try_pop q immediately pops the first element of q, if any, or returns None without blocking.

  • parameter force_lock

    if true, use Mutex.lock (which can block under contention); if false, use Mutex.try_lock, which might return None even in presence of an element if there's contention

val try_push : 'a t -> 'a -> bool

try_push q x tries to push into q, in which case it returns true; or it fails to push and returns false without blocking.

  • raises Closed

    if the locking succeeded but the queue is closed.

val transfer : 'a t -> 'a Stdlib.Queue.t -> unit

transfer bq q2 transfers all items presently in bq into q2 in one atomic section, and clears bq. It blocks if no element is in bq.

This is useful to consume elements from the queue in batch. Create a Queue.t locally:

let dowork (work_queue: job Bb_queue.t) =
   (* local queue, not thread safe *)
   let local_q = Queue.create() in
   try
diff --git a/dev/moonpool/Moonpool/Bounded_queue/index.html b/dev/moonpool/Moonpool/Bounded_queue/index.html
index 29ca03a9..d9f05ab8 100644
--- a/dev/moonpool/Moonpool/Bounded_queue/index.html
+++ b/dev/moonpool/Moonpool/Bounded_queue/index.html
@@ -1,2 +1,2 @@
 
-Bounded_queue (moonpool.Moonpool.Bounded_queue)

Module Moonpool.Bounded_queue

A blocking queue of finite size.

This queue, while still using locks underneath (like the regular blocking queue) should be enough for usage under reasonable contention.

The bounded size is helpful whenever some form of backpressure is desirable: if the queue is used to communicate between producer(s) and consumer(s), the consumer(s) can limit the rate at which producer(s) send new work down their way. Whenever the queue is full, means that producer(s) will have to wait before pushing new work.

  • since 0.4
type 'a t

A bounded queue.

val create : max_size:int -> unit -> 'a t
val close : _ t -> unit

close q closes q. No new elements can be pushed into q, and after all the elements still in q currently are pop'd, pop will also raise Closed.

exception Closed
val push : 'a t -> 'a -> unit

push q x pushes x at the end of the queue. If q is full, this will block until there is room for x.

val try_push : force_lock:bool -> 'a t -> 'a -> bool

try_push q x attempts to push x into q, but abandons if it cannot acquire q or if q is full.

  • parameter force_lock

    if true, use Mutex.lock (which can block under contention); if false, use Mutex.try_lock, which might return false even if there's room in the queue.

val pop : 'a t -> 'a

pop q pops the first element off q. It blocks if q is empty, until some element becomes available.

  • raises Closed

    if q is empty and closed.

val try_pop : force_lock:bool -> 'a t -> 'a option

try_pop ~force_lock q tries to pop the first element, or returns None if no element is available or if it failed to acquire q.

  • parameter force_lock

    if true, use Mutex.lock (which can block under contention); if false, use Mutex.try_lock, which might return None even in presence of an element if there's contention.

  • raises Closed

    if q is empty and closed.

val size : _ t -> int

Number of elements currently in q

val max_size : _ t -> int

Maximum size of the queue. See create.

val transfer : 'a t -> 'a Stdlib.Queue.t -> unit

transfer bq q2 transfers all elements currently available in bq into local queue q2, and clears bq, atomically. It blocks if bq is empty.

See Bb_queue.transfer for more details.

  • raises Closed

    if bq is empty and closed.

type 'a gen = unit -> 'a option
type 'a iter = ('a -> unit) -> unit
val to_iter : 'a t -> 'a iter

to_iter q returns an iterator over all items in the queue. This might not terminate if q is never closed.

val to_gen : 'a t -> 'a gen

to_gen q returns a generator from the queue.

val to_seq : 'a t -> 'a Stdlib.Seq.t

to_gen q returns a (transient) sequence from the queue.

+Bounded_queue (moonpool.Moonpool.Bounded_queue)

Module Moonpool.Bounded_queue

A blocking queue of finite size.

This queue, while still using locks underneath (like the regular blocking queue) should be enough for usage under reasonable contention.

The bounded size is helpful whenever some form of backpressure is desirable: if the queue is used to communicate between producer(s) and consumer(s), the consumer(s) can limit the rate at which producer(s) send new work down their way. Whenever the queue is full, means that producer(s) will have to wait before pushing new work.

  • since 0.4
type 'a t

A bounded queue.

val create : max_size:int -> unit -> 'a t
val close : _ t -> unit

close q closes q. No new elements can be pushed into q, and after all the elements still in q currently are pop'd, pop will also raise Closed.

exception Closed
val push : 'a t -> 'a -> unit

push q x pushes x at the end of the queue. If q is full, this will block until there is room for x.

val try_push : force_lock:bool -> 'a t -> 'a -> bool

try_push q x attempts to push x into q, but abandons if it cannot acquire q or if q is full.

  • parameter force_lock

    if true, use Mutex.lock (which can block under contention); if false, use Mutex.try_lock, which might return false even if there's room in the queue.

val pop : 'a t -> 'a

pop q pops the first element off q. It blocks if q is empty, until some element becomes available.

  • raises Closed

    if q is empty and closed.

val try_pop : force_lock:bool -> 'a t -> 'a option

try_pop ~force_lock q tries to pop the first element, or returns None if no element is available or if it failed to acquire q.

  • parameter force_lock

    if true, use Mutex.lock (which can block under contention); if false, use Mutex.try_lock, which might return None even in presence of an element if there's contention.

  • raises Closed

    if q is empty and closed.

val size : _ t -> int

Number of elements currently in q

val max_size : _ t -> int

Maximum size of the queue. See create.

val transfer : 'a t -> 'a Stdlib.Queue.t -> unit

transfer bq q2 transfers all elements currently available in bq into local queue q2, and clears bq, atomically. It blocks if bq is empty.

See Bb_queue.transfer for more details.

  • raises Closed

    if bq is empty and closed.

type 'a gen = unit -> 'a option
type 'a iter = ('a -> unit) -> unit
val to_iter : 'a t -> 'a iter

to_iter q returns an iterator over all items in the queue. This might not terminate if q is never closed.

val to_gen : 'a t -> 'a gen

to_gen q returns a generator from the queue.

val to_seq : 'a t -> 'a Stdlib.Seq.t

to_gen q returns a (transient) sequence from the queue.

diff --git a/dev/moonpool/Moonpool/Chan/index.html b/dev/moonpool/Moonpool/Chan/index.html index 1ca3b25d..6b560db5 100644 --- a/dev/moonpool/Moonpool/Chan/index.html +++ b/dev/moonpool/Moonpool/Chan/index.html @@ -1,2 +1,2 @@ -Chan (moonpool.Moonpool.Chan)

Module Moonpool.Chan

Channels.

Channels are pipelines of values where threads can push into one end, and pull from the other end.

Unlike Moonpool.Blocking_queue, channels are designed so that pushing never blocks, and pop'ing values returns a future.

  • since 0.3
type 'a or_error = 'a Fut.or_error
type 'a t

Channel carrying values of type 'a.

val create : unit -> 'a t

Create a channel.

exception Closed
val push : 'a t -> 'a -> unit

push chan x pushes x into chan. This does not block.

  • raises Closed

    if the channel is closed.

val pop : 'a t -> 'a Fut.t

Pop an element. This returns a future that will be fulfilled when an element is available.

  • raises Closed

    if the channel is closed, or fails the future if the channel is closed before an element is available for it.

val try_pop : 'a t -> 'a option

try_pop chan pops and return an element if one is available immediately. Otherwise it returns None.

val pop_block_exn : 'a t -> 'a

Like pop, but blocks if an element is not available immediately. The precautions around blocking from inside a thread pool are the same as explained in Fut.wait_block.

val close : _ t -> unit

Close the channel. Further push and pop calls will fail. This is idempotent.

val pop_await : 'a t -> 'a

Like pop but suspends the current thread until an element is available. See await for more details.

  • since 0.3
+Chan (moonpool.Moonpool.Chan)

Module Moonpool.Chan

Channels.

Channels are pipelines of values where threads can push into one end, and pull from the other end.

Unlike Moonpool.Blocking_queue, channels are designed so that pushing never blocks, and pop'ing values returns a future.

  • since 0.3
type 'a or_error = 'a Fut.or_error
type 'a t

Channel carrying values of type 'a.

val create : unit -> 'a t

Create a channel.

exception Closed
val push : 'a t -> 'a -> unit

push chan x pushes x into chan. This does not block.

  • raises Closed

    if the channel is closed.

val pop : 'a t -> 'a Fut.t

Pop an element. This returns a future that will be fulfilled when an element is available.

  • raises Closed

    if the channel is closed, or fails the future if the channel is closed before an element is available for it.

val try_pop : 'a t -> 'a option

try_pop chan pops and return an element if one is available immediately. Otherwise it returns None.

val pop_block_exn : 'a t -> 'a

Like pop, but blocks if an element is not available immediately. The precautions around blocking from inside a thread pool are the same as explained in Fut.wait_block.

val close : _ t -> unit

Close the channel. Further push and pop calls will fail. This is idempotent.

val pop_await : 'a t -> 'a

Like pop but suspends the current thread until an element is available. See await for more details.

  • since 0.3
diff --git a/dev/moonpool/Moonpool/Fifo_pool/For_runner_implementors/index.html b/dev/moonpool/Moonpool/Fifo_pool/For_runner_implementors/index.html index ec69133d..77ba3cfe 100644 --- a/dev/moonpool/Moonpool/Fifo_pool/For_runner_implementors/index.html +++ b/dev/moonpool/Moonpool/Fifo_pool/For_runner_implementors/index.html @@ -1,8 +1,8 @@ -For_runner_implementors (moonpool.Moonpool.Fifo_pool.For_runner_implementors)

Module Fifo_pool.For_runner_implementors

This module is specifically intended for users who implement their own runners. Regular users of Moonpool should not need to look at it.

val create : +For_runner_implementors (moonpool.Moonpool.Fifo_pool.For_runner_implementors)

Module Fifo_pool.For_runner_implementors

This module is specifically intended for users who implement their own runners. Regular users of Moonpool should not need to look at it.

val create : size:(unit -> int) -> num_tasks:(unit -> int) -> shutdown:(wait:bool -> unit -> unit) -> - run_async:(task -> unit) -> + run_async:(name:string -> task -> unit) -> unit -> - t

Create a new runner.

NOTE: the runner should support DLA and Suspend_ on OCaml 5.x, so that Fork_join and other 5.x features work properly.

val k_cur_runner : t option ref Moonpool__.Thread_local_storage_.key
+ t

Create a new runner.

NOTE: the runner should support DLA and Suspend_ on OCaml 5.x, so that Fork_join and other 5.x features work properly.

val k_cur_runner : t option ref Moonpool__.Thread_local_storage_.key

Key that should be used by each runner to store itself in TLS on every thread it controls, so that tasks running on these threads can access the runner. This is necessary for get_current_runner to work.

diff --git a/dev/moonpool/Moonpool/Fifo_pool/index.html b/dev/moonpool/Moonpool/Fifo_pool/index.html index 3ec08713..8d9380c0 100644 --- a/dev/moonpool/Moonpool/Fifo_pool/index.html +++ b/dev/moonpool/Moonpool/Fifo_pool/index.html @@ -1,5 +1,5 @@ -Fifo_pool (moonpool.Moonpool.Fifo_pool)

Module Moonpool.Fifo_pool

A simple thread pool in FIFO order.

FIFO: first-in, first-out. Basically tasks are put into a queue, and worker threads pull them out of the queue at the other end.

Since this uses a single blocking queue to manage tasks, it's very simple and reliable. The number of worker threads is fixed, but they are spread over several domains to enable parallelism.

This can be useful for latency-sensitive applications (e.g. as a pool of workers for network servers). Work-stealing pools might have higher throughput but they're very unfair to some tasks; by contrast, here, older tasks have priority over younger tasks.

  • since 0.5
include module type of Runner
type task = unit -> unit
type t

A runner.

If a runner is no longer needed, shutdown can be used to signal all worker threads in it to stop (after they finish their work), and wait for them to stop.

The threads are distributed across a fixed domain pool (whose size is determined by Domain.recommended_domain_count on OCaml 5, and simple the single runtime on OCaml 4).

val size : t -> int

Number of threads/workers.

val num_tasks : t -> int

Current number of tasks. This is at best a snapshot, useful for metrics and debugging.

val shutdown : t -> unit

Shutdown the runner and wait for it to terminate. Idempotent.

val shutdown_without_waiting : t -> unit

Shutdown the pool, and do not wait for it to terminate. Idempotent.

exception Shutdown
val run_async : t -> task -> unit

run_async pool f schedules f for later execution on the runner in one of the threads. f() will run on one of the runner's worker threads/domains.

  • raises Shutdown

    if the runner was shut down before run_async was called.

val run_wait_block : t -> (unit -> 'a) -> 'a

run_wait_block pool f schedules f for later execution on the pool, like run_async. It then blocks the current thread until f() is done executing, and returns its result. If f() raises an exception, then run_wait_block pool f will raise it as well.

NOTE be careful with deadlocks (see notes in Fut.wait_block about the required discipline to avoid deadlocks).

module For_runner_implementors : sig ... end

This module is specifically intended for users who implement their own runners. Regular users of Moonpool should not need to look at it.

val get_current_runner : unit -> t option

Access the current runner. This returns Some r if the call happens on a thread that belongs in a runner.

  • since 0.5
type ('a, 'b) create_args = +Fifo_pool (moonpool.Moonpool.Fifo_pool)

Module Moonpool.Fifo_pool

A simple thread pool in FIFO order.

FIFO: first-in, first-out. Basically tasks are put into a queue, and worker threads pull them out of the queue at the other end.

Since this uses a single blocking queue to manage tasks, it's very simple and reliable. The number of worker threads is fixed, but they are spread over several domains to enable parallelism.

This can be useful for latency-sensitive applications (e.g. as a pool of workers for network servers). Work-stealing pools might have higher throughput but they're very unfair to some tasks; by contrast, here, older tasks have priority over younger tasks.

  • since 0.5
include module type of Runner
type task = unit -> unit
type t

A runner.

If a runner is no longer needed, shutdown can be used to signal all worker threads in it to stop (after they finish their work), and wait for them to stop.

The threads are distributed across a fixed domain pool (whose size is determined by Domain.recommended_domain_count on OCaml 5, and simple the single runtime on OCaml 4).

val size : t -> int

Number of threads/workers.

val num_tasks : t -> int

Current number of tasks. This is at best a snapshot, useful for metrics and debugging.

val shutdown : t -> unit

Shutdown the runner and wait for it to terminate. Idempotent.

val shutdown_without_waiting : t -> unit

Shutdown the pool, and do not wait for it to terminate. Idempotent.

exception Shutdown
val run_async : ?name:string -> t -> task -> unit

run_async pool f schedules f for later execution on the runner in one of the threads. f() will run on one of the runner's worker threads/domains.

  • parameter name

    if provided and Trace is present in dependencies, a span will be created when the task starts, and will stop when the task is over. (since NEXT_RELEASE)

  • raises Shutdown

    if the runner was shut down before run_async was called.

val run_wait_block : ?name:string -> t -> (unit -> 'a) -> 'a

run_wait_block pool f schedules f for later execution on the pool, like run_async. It then blocks the current thread until f() is done executing, and returns its result. If f() raises an exception, then run_wait_block pool f will raise it as well.

NOTE be careful with deadlocks (see notes in Fut.wait_block about the required discipline to avoid deadlocks).

  • raises Shutdown

    if the runner was already shut down

Implementing runners

module For_runner_implementors : sig ... end

This module is specifically intended for users who implement their own runners. Regular users of Moonpool should not need to look at it.

val get_current_runner : unit -> t option

Access the current runner. This returns Some r if the call happens on a thread that belongs in a runner.

  • since 0.5
type ('a, 'b) create_args = ?on_init_thread:(dom_id:int -> t_id:int -> unit -> unit) -> ?on_exit_thread:(dom_id:int -> t_id:int -> unit -> unit) -> ?on_exn:(exn -> Stdlib.Printexc.raw_backtrace -> unit) -> diff --git a/dev/moonpool/Moonpool/Fork_join/index.html b/dev/moonpool/Moonpool/Fork_join/index.html index 7daf7a14..22f8b7dc 100644 --- a/dev/moonpool/Moonpool/Fork_join/index.html +++ b/dev/moonpool/Moonpool/Fork_join/index.html @@ -1,5 +1,5 @@ -Fork_join (moonpool.Moonpool.Fork_join)

Module Moonpool.Fork_join

Fork-join primitives.

NOTE These are only available on OCaml 5.0 and above.

  • since 0.3
val both : (unit -> 'a) -> (unit -> 'b) -> 'a * 'b

both f g runs f() and g(), potentially in parallel, and returns their result when both are done. If any of f() and g() fails, then the whole computation fails.

This must be run from within the pool: for example, inside Pool.run or inside a Fut.spawn computation. This is because it relies on an effect handler to be installed.

  • since 0.3

NOTE this is only available on OCaml 5.

val both_ignore : (unit -> _) -> (unit -> _) -> unit

Same as both f g |> ignore.

  • since 0.3

NOTE this is only available on OCaml 5.

val for_ : ?chunk_size:int -> int -> (int -> int -> unit) -> unit

for_ n f is the parallel version of for i=0 to n-1 do f i done.

f is called with parameters low and high and must use them like so:

for j = low to high do (* … actual work *) done 

. If chunk_size=1 then low=high and the loop is not actually needed.

  • parameter chunk_size

    controls the granularity of parallelism. The default chunk size is not specified. See all_array or all_list for more details.

    Example:

    let total_sum = Atomic.make 0
    +Fork_join (moonpool.Moonpool.Fork_join)

    Module Moonpool.Fork_join

    Fork-join primitives.

    NOTE These are only available on OCaml 5.0 and above.

    • since 0.3
    val both : (unit -> 'a) -> (unit -> 'b) -> 'a * 'b

    both f g runs f() and g(), potentially in parallel, and returns their result when both are done. If any of f() and g() fails, then the whole computation fails.

    This must be run from within the pool: for example, inside Pool.run or inside a Fut.spawn computation. This is because it relies on an effect handler to be installed.

    • since 0.3

    NOTE this is only available on OCaml 5.

    val both_ignore : (unit -> _) -> (unit -> _) -> unit

    Same as both f g |> ignore.

    • since 0.3

    NOTE this is only available on OCaml 5.

    val for_ : ?chunk_size:int -> int -> (int -> int -> unit) -> unit

    for_ n f is the parallel version of for i=0 to n-1 do f i done.

    f is called with parameters low and high and must use them like so:

    for j = low to high do (* … actual work *) done 

    . If chunk_size=1 then low=high and the loop is not actually needed.

    • parameter chunk_size

      controls the granularity of parallelism. The default chunk size is not specified. See all_array or all_list for more details.

      Example:

      let total_sum = Atomic.make 0
       
       let() = for_ ~chunk_size:5 100
         (fun low high ->
      diff --git a/dev/moonpool/Moonpool/Fut/Advanced/index.html b/dev/moonpool/Moonpool/Fut/Advanced/index.html
      index b45006e2..d340797c 100644
      --- a/dev/moonpool/Moonpool/Fut/Advanced/index.html
      +++ b/dev/moonpool/Moonpool/Fut/Advanced/index.html
      @@ -1,5 +1,5 @@
       
      -Advanced (moonpool.Moonpool.Fut.Advanced)

      Module Fut.Advanced

      val barrier_on_abstract_container_of_futures : +Advanced (moonpool.Moonpool.Fut.Advanced)

      Module Fut.Advanced

      val barrier_on_abstract_container_of_futures : iter:(('a t -> unit) -> 'cont -> unit) -> len:('cont -> int) -> aggregate_results:(('a t -> 'a) -> 'cont -> 'res) -> diff --git a/dev/moonpool/Moonpool/Fut/Infix/index.html b/dev/moonpool/Moonpool/Fut/Infix/index.html index 2c2cd687..9991030f 100644 --- a/dev/moonpool/Moonpool/Fut/Infix/index.html +++ b/dev/moonpool/Moonpool/Fut/Infix/index.html @@ -1,2 +1,2 @@ -Infix (moonpool.Moonpool.Fut.Infix)

      Module Fut.Infix

      • since 0.5
      val (>|=) : 'a t -> ('a -> 'b) -> 'b t
      val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
      val let+ : 'a t -> ('a -> 'b) -> 'b t
      val and+ : 'a t -> 'b t -> ('a * 'b) t
      val let* : 'a t -> ('a -> 'b t) -> 'b t
      val and* : 'a t -> 'b t -> ('a * 'b) t
      +Infix (moonpool.Moonpool.Fut.Infix)

      Module Fut.Infix

      • since 0.5
      val (>|=) : 'a t -> ('a -> 'b) -> 'b t
      val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
      val let+ : 'a t -> ('a -> 'b) -> 'b t
      val and+ : 'a t -> 'b t -> ('a * 'b) t
      val let* : 'a t -> ('a -> 'b t) -> 'b t
      val and* : 'a t -> 'b t -> ('a * 'b) t
      diff --git a/dev/moonpool/Moonpool/Fut/index.html b/dev/moonpool/Moonpool/Fut/index.html index af8e8e2c..e4668b65 100644 --- a/dev/moonpool/Moonpool/Fut/index.html +++ b/dev/moonpool/Moonpool/Fut/index.html @@ -1,2 +1,2 @@ -Fut (moonpool.Moonpool.Fut)

      Module Moonpool.Fut

      Futures.

      A future of type 'a t represents the result of a computation that will yield a value of type 'a.

      Typically, the computation is running on a thread pool Runner.t and will proceed on some worker. Once set, a future cannot change. It either succeeds (storing a Ok x with x: 'a), or fail (storing a Error (exn, bt) with an exception and the corresponding backtrace).

      Combinators such as map and join_array can be used to produce futures from other futures (in a monadic way). Some combinators take a on argument to specify a runner on which the intermediate computation takes place; for example map ~on:pool ~f fut maps the value in fut using function f, applicatively; the call to f happens on the runner pool (once fut resolves successfully with a value).

      type 'a or_error = ('a, exn * Stdlib.Printexc.raw_backtrace) result
      type 'a t

      A future with a result of type 'a.

      type 'a promise

      A promise, which can be fulfilled exactly once to set the corresponding future

      val make : unit -> 'a t * 'a promise

      Make a new future with the associated promise

      val on_result : 'a t -> ('a or_error -> unit) -> unit

      on_result fut f registers f to be called in the future when fut is set ; or calls f immediately if fut is already set.

      exception Already_fulfilled
      val fulfill : 'a promise -> 'a or_error -> unit

      Fullfill the promise, setting the future at the same time.

      val fulfill_idempotent : 'a promise -> 'a or_error -> unit

      Fullfill the promise, setting the future at the same time. Does nothing if the promise is already fulfilled.

      val return : 'a -> 'a t

      Already settled future, with a result

      val fail : exn -> Stdlib.Printexc.raw_backtrace -> _ t

      Already settled future, with a failure

      val of_result : 'a or_error -> 'a t
      val is_resolved : _ t -> bool

      is_resolved fut is true iff fut is resolved.

      val peek : 'a t -> 'a or_error option

      peek fut returns Some r if fut is currently resolved with r, and None if fut is not resolved yet.

      exception Not_ready
      • since 0.2
      val get_or_fail : 'a t -> 'a or_error

      get_or_fail fut obtains the result from fut if it's fulfilled (i.e. if peek fut returns Some res, get_or_fail fut returns res).

      • since 0.2
      val get_or_fail_exn : 'a t -> 'a

      get_or_fail_exn fut obtains the result from fut if it's fulfilled, like get_or_fail. If the result is an Error _, the exception inside is re-raised.

      • since 0.2
      val is_done : _ t -> bool

      Is the future resolved? This is the same as peek fut |> Option.is_some.

      • since 0.2

      Combinators

      val spawn : on:Runner.t -> (unit -> 'a) -> 'a t

      spaw ~on f runs f() on the given runner on, and return a future that will hold its result.

      val spawn_on_current_runner : (unit -> 'a) -> 'a t

      This must be run from inside a runner, and schedules the new task on it as well.

      See Runner.get_current_runner to see how the runner is found.

      • since 0.5
      • raises Failure

        if run from outside a runner.

      val reify_error : 'a t -> 'a or_error t

      reify_error fut turns a failing future into a non-failing one that contain Error (exn, bt). A non-failing future returning x is turned into Ok x

      • since 0.4
      val map : ?on:Runner.t -> f:('a -> 'b) -> 'a t -> 'b t

      map ?on ~f fut returns a new future fut2 that resolves with f x if fut resolved with x; and fails with e if fut fails with e or f x raises e.

      • parameter on

        if provided, f runs on the given runner

      val bind : ?on:Runner.t -> f:('a -> 'b t) -> 'a t -> 'b t

      bind ?on ~f fut returns a new future fut2 that resolves like the future f x if fut resolved with x; and fails with e if fut fails with e or f x raises e.

      • parameter on

        if provided, f runs on the given runner

      val bind_reify_error : ?on:Runner.t -> f:('a or_error -> 'b t) -> 'a t -> 'b t

      bind_reify_error ?on ~f fut returns a new future fut2 that resolves like the future f (Ok x) if fut resolved with x; and resolves like the future f (Error (exn, bt)) if fut fails with exn and backtrace bt.

      • parameter on

        if provided, f runs on the given runner

      • since 0.4
      val join : 'a t t -> 'a t

      join fut is fut >>= Fun.id. It joins the inner layer of the future.

      • since 0.2
      val both : 'a t -> 'b t -> ('a * 'b) t

      both a b succeeds with x, y if a succeeds with x and b succeeds with y, or fails if any of them fails.

      val choose : 'a t -> 'b t -> ('a, 'b) Either.t t

      choose a b succeeds Left x or Right y if a succeeds with x or b succeeds with y, or fails if both of them fails. If they both succeed, it is not specified which result is used.

      val choose_same : 'a t -> 'a t -> 'a t

      choose_same a b succeeds with the value of one of a or b if they succeed, or fails if both fail. If they both succeed, it is not specified which result is used.

      val join_array : 'a t array -> 'a array t

      Wait for all the futures in the array. Fails if any future fails.

      val join_list : 'a t list -> 'a list t

      Wait for all the futures in the list. Fails if any future fails.

      module Advanced : sig ... end
      val map_list : f:('a -> 'b t) -> 'a list -> 'b list t

      map_list ~f l is like join_list @@ List.map f l.

      • since NEXT_RELEASE
      val wait_array : _ t array -> unit t

      wait_array arr waits for all futures in arr to resolve. It discards the individual results of futures in arr. It fails if any future fails.

      val wait_list : _ t list -> unit t

      wait_list l waits for all futures in l to resolve. It discards the individual results of futures in l. It fails if any future fails.

      val for_ : on:Runner.t -> int -> (int -> unit) -> unit t

      for_ ~on n f runs f 0, f 1, …, f (n-1) on the runner, and returns a future that resolves when all the tasks have resolved, or fails as soon as one task has failed.

      val for_array : on:Runner.t -> 'a array -> (int -> 'a -> unit) -> unit t

      for_array ~on arr f runs f 0 arr.(0), …, f (n-1) arr.(n-1) in the runner (where n = Array.length arr), and returns a future that resolves when all the tasks are done, or fails if any of them fails.

      • since 0.2
      val for_list : on:Runner.t -> 'a list -> ('a -> unit) -> unit t

      for_list ~on l f is like for_array ~on (Array.of_list l) f.

      • since 0.2

      Await

      NOTE This is only available on OCaml 5.

      val await : 'a t -> 'a

      await fut suspends the current tasks until fut is fulfilled, then resumes the task on this same runner.

      • since 0.3

      This must only be run from inside the runner itself. The runner must support Suspend_. NOTE: only on OCaml 5.x

      Blocking

      val wait_block : 'a t -> 'a or_error

      wait_block fut blocks the current thread until fut is resolved, and returns its value.

      NOTE: A word of warning: this will monopolize the calling thread until the future resolves. This can also easily cause deadlocks, if enough threads in a pool call wait_block on futures running on the same pool or a pool depending on it.

      A good rule to avoid deadlocks is to run this from outside of any pool, or to have an acyclic order between pools where wait_block is only called from a pool on futures evaluated in a pool that comes lower in the hierarchy. If this rule is broken, it is possible for all threads in a pool to wait for futures that can only make progress on these same threads, hence the deadlock.

      val wait_block_exn : 'a t -> 'a

      Same as wait_block but re-raises the exception if the future failed.

      Infix operators

      These combinators run on either the current pool (if present), or on the same thread that just fulfilled the previous future if not.

      They were previously present as module Infix_local and val infix, but are now simplified.

      • since 0.5
      module Infix : sig ... end
      include module type of Infix
      • since 0.5
      val (>|=) : 'a t -> ('a -> 'b) -> 'b t
      val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
      val let+ : 'a t -> ('a -> 'b) -> 'b t
      val and+ : 'a t -> 'b t -> ('a * 'b) t
      val let* : 'a t -> ('a -> 'b t) -> 'b t
      val and* : 'a t -> 'b t -> ('a * 'b) t
      module Infix_local = Infix
      +Fut (moonpool.Moonpool.Fut)

      Module Moonpool.Fut

      Futures.

      A future of type 'a t represents the result of a computation that will yield a value of type 'a.

      Typically, the computation is running on a thread pool Runner.t and will proceed on some worker. Once set, a future cannot change. It either succeeds (storing a Ok x with x: 'a), or fail (storing a Error (exn, bt) with an exception and the corresponding backtrace).

      Combinators such as map and join_array can be used to produce futures from other futures (in a monadic way). Some combinators take a on argument to specify a runner on which the intermediate computation takes place; for example map ~on:pool ~f fut maps the value in fut using function f, applicatively; the call to f happens on the runner pool (once fut resolves successfully with a value).

      type 'a or_error = ('a, exn * Stdlib.Printexc.raw_backtrace) result
      type 'a t

      A future with a result of type 'a.

      type 'a promise

      A promise, which can be fulfilled exactly once to set the corresponding future

      val make : ?name:string -> unit -> 'a t * 'a promise

      Make a new future with the associated promise.

      • parameter name

        name for the future, used for tracing. since NEXT_RELEASE.

      val on_result : 'a t -> ('a or_error -> unit) -> unit

      on_result fut f registers f to be called in the future when fut is set ; or calls f immediately if fut is already set.

      exception Already_fulfilled
      val fulfill : 'a promise -> 'a or_error -> unit

      Fullfill the promise, setting the future at the same time.

      val fulfill_idempotent : 'a promise -> 'a or_error -> unit

      Fullfill the promise, setting the future at the same time. Does nothing if the promise is already fulfilled.

      val return : 'a -> 'a t

      Already settled future, with a result

      val fail : exn -> Stdlib.Printexc.raw_backtrace -> _ t

      Already settled future, with a failure

      val of_result : 'a or_error -> 'a t
      val is_resolved : _ t -> bool

      is_resolved fut is true iff fut is resolved.

      val peek : 'a t -> 'a or_error option

      peek fut returns Some r if fut is currently resolved with r, and None if fut is not resolved yet.

      exception Not_ready
      • since 0.2
      val get_or_fail : 'a t -> 'a or_error

      get_or_fail fut obtains the result from fut if it's fulfilled (i.e. if peek fut returns Some res, get_or_fail fut returns res).

      • since 0.2
      val get_or_fail_exn : 'a t -> 'a

      get_or_fail_exn fut obtains the result from fut if it's fulfilled, like get_or_fail. If the result is an Error _, the exception inside is re-raised.

      • since 0.2
      val is_done : _ t -> bool

      Is the future resolved? This is the same as peek fut |> Option.is_some.

      • since 0.2

      Combinators

      val spawn : ?name:string -> on:Runner.t -> (unit -> 'a) -> 'a t

      spaw ~on f runs f() on the given runner on, and return a future that will hold its result.

      val spawn_on_current_runner : ?name:string -> (unit -> 'a) -> 'a t

      This must be run from inside a runner, and schedules the new task on it as well.

      See Runner.get_current_runner to see how the runner is found.

      • since 0.5
      • raises Failure

        if run from outside a runner.

      val reify_error : 'a t -> 'a or_error t

      reify_error fut turns a failing future into a non-failing one that contain Error (exn, bt). A non-failing future returning x is turned into Ok x

      • since 0.4
      val map : ?on:Runner.t -> f:('a -> 'b) -> 'a t -> 'b t

      map ?on ~f fut returns a new future fut2 that resolves with f x if fut resolved with x; and fails with e if fut fails with e or f x raises e.

      • parameter on

        if provided, f runs on the given runner

      val bind : ?on:Runner.t -> f:('a -> 'b t) -> 'a t -> 'b t

      bind ?on ~f fut returns a new future fut2 that resolves like the future f x if fut resolved with x; and fails with e if fut fails with e or f x raises e.

      • parameter on

        if provided, f runs on the given runner

      val bind_reify_error : ?on:Runner.t -> f:('a or_error -> 'b t) -> 'a t -> 'b t

      bind_reify_error ?on ~f fut returns a new future fut2 that resolves like the future f (Ok x) if fut resolved with x; and resolves like the future f (Error (exn, bt)) if fut fails with exn and backtrace bt.

      • parameter on

        if provided, f runs on the given runner

      • since 0.4
      val join : 'a t t -> 'a t

      join fut is fut >>= Fun.id. It joins the inner layer of the future.

      • since 0.2
      val both : 'a t -> 'b t -> ('a * 'b) t

      both a b succeeds with x, y if a succeeds with x and b succeeds with y, or fails if any of them fails.

      val choose : 'a t -> 'b t -> ('a, 'b) Either.t t

      choose a b succeeds Left x or Right y if a succeeds with x or b succeeds with y, or fails if both of them fails. If they both succeed, it is not specified which result is used.

      val choose_same : 'a t -> 'a t -> 'a t

      choose_same a b succeeds with the value of one of a or b if they succeed, or fails if both fail. If they both succeed, it is not specified which result is used.

      val join_array : 'a t array -> 'a array t

      Wait for all the futures in the array. Fails if any future fails.

      val join_list : 'a t list -> 'a list t

      Wait for all the futures in the list. Fails if any future fails.

      module Advanced : sig ... end
      val map_list : f:('a -> 'b t) -> 'a list -> 'b list t

      map_list ~f l is like join_list @@ List.map f l.

      • since NEXT_RELEASE
      val wait_array : _ t array -> unit t

      wait_array arr waits for all futures in arr to resolve. It discards the individual results of futures in arr. It fails if any future fails.

      val wait_list : _ t list -> unit t

      wait_list l waits for all futures in l to resolve. It discards the individual results of futures in l. It fails if any future fails.

      val for_ : on:Runner.t -> int -> (int -> unit) -> unit t

      for_ ~on n f runs f 0, f 1, …, f (n-1) on the runner, and returns a future that resolves when all the tasks have resolved, or fails as soon as one task has failed.

      val for_array : on:Runner.t -> 'a array -> (int -> 'a -> unit) -> unit t

      for_array ~on arr f runs f 0 arr.(0), …, f (n-1) arr.(n-1) in the runner (where n = Array.length arr), and returns a future that resolves when all the tasks are done, or fails if any of them fails.

      • since 0.2
      val for_list : on:Runner.t -> 'a list -> ('a -> unit) -> unit t

      for_list ~on l f is like for_array ~on (Array.of_list l) f.

      • since 0.2

      Await

      NOTE This is only available on OCaml 5.

      val await : 'a t -> 'a

      await fut suspends the current tasks until fut is fulfilled, then resumes the task on this same runner.

      • since 0.3

      This must only be run from inside the runner itself. The runner must support Suspend_. NOTE: only on OCaml 5.x

      Blocking

      val wait_block : 'a t -> 'a or_error

      wait_block fut blocks the current thread until fut is resolved, and returns its value.

      NOTE: A word of warning: this will monopolize the calling thread until the future resolves. This can also easily cause deadlocks, if enough threads in a pool call wait_block on futures running on the same pool or a pool depending on it.

      A good rule to avoid deadlocks is to run this from outside of any pool, or to have an acyclic order between pools where wait_block is only called from a pool on futures evaluated in a pool that comes lower in the hierarchy. If this rule is broken, it is possible for all threads in a pool to wait for futures that can only make progress on these same threads, hence the deadlock.

      val wait_block_exn : 'a t -> 'a

      Same as wait_block but re-raises the exception if the future failed.

      Infix operators

      These combinators run on either the current pool (if present), or on the same thread that just fulfilled the previous future if not.

      They were previously present as module Infix_local and val infix, but are now simplified.

      • since 0.5
      module Infix : sig ... end
      include module type of Infix
      • since 0.5
      val (>|=) : 'a t -> ('a -> 'b) -> 'b t
      val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
      val let+ : 'a t -> ('a -> 'b) -> 'b t
      val and+ : 'a t -> 'b t -> ('a * 'b) t
      val let* : 'a t -> ('a -> 'b t) -> 'b t
      val and* : 'a t -> 'b t -> ('a * 'b) t
      module Infix_local = Infix
      diff --git a/dev/moonpool/Moonpool/Immediate_runner/For_runner_implementors/index.html b/dev/moonpool/Moonpool/Immediate_runner/For_runner_implementors/index.html index 9749143e..6494de98 100644 --- a/dev/moonpool/Moonpool/Immediate_runner/For_runner_implementors/index.html +++ b/dev/moonpool/Moonpool/Immediate_runner/For_runner_implementors/index.html @@ -1,8 +1,8 @@ -For_runner_implementors (moonpool.Moonpool.Immediate_runner.For_runner_implementors)

      Module Immediate_runner.For_runner_implementors

      This module is specifically intended for users who implement their own runners. Regular users of Moonpool should not need to look at it.

      val create : +For_runner_implementors (moonpool.Moonpool.Immediate_runner.For_runner_implementors)

      Module Immediate_runner.For_runner_implementors

      This module is specifically intended for users who implement their own runners. Regular users of Moonpool should not need to look at it.

      val create : size:(unit -> int) -> num_tasks:(unit -> int) -> shutdown:(wait:bool -> unit -> unit) -> - run_async:(task -> unit) -> + run_async:(name:string -> task -> unit) -> unit -> - t

      Create a new runner.

      NOTE: the runner should support DLA and Suspend_ on OCaml 5.x, so that Fork_join and other 5.x features work properly.

      val k_cur_runner : t option ref Moonpool__.Thread_local_storage_.key
      + t

      Create a new runner.

      NOTE: the runner should support DLA and Suspend_ on OCaml 5.x, so that Fork_join and other 5.x features work properly.

      val k_cur_runner : t option ref Moonpool__.Thread_local_storage_.key

      Key that should be used by each runner to store itself in TLS on every thread it controls, so that tasks running on these threads can access the runner. This is necessary for get_current_runner to work.

      diff --git a/dev/moonpool/Moonpool/Immediate_runner/index.html b/dev/moonpool/Moonpool/Immediate_runner/index.html index f9e81550..240bff6b 100644 --- a/dev/moonpool/Moonpool/Immediate_runner/index.html +++ b/dev/moonpool/Moonpool/Immediate_runner/index.html @@ -1,2 +1,2 @@ -Immediate_runner (moonpool.Moonpool.Immediate_runner)

      Module Moonpool.Immediate_runner

      Runner that runs tasks immediately in the caller thread.

      Whenever a task is submitted to this runner via Runner.run_async r task, the task is run immediately in the caller thread as task(). There are no background threads, no resource, this is just a trivial implementation of the interface.

      This can be useful when an implementation needs a runner, but there isn't enough work to justify starting an actual full thread pool.

      Another situation is when threads cannot be used at all (e.g. because you plan to call Unix.fork later).

      • since 0.5
      include module type of Runner
      type task = unit -> unit
      type t

      A runner.

      If a runner is no longer needed, shutdown can be used to signal all worker threads in it to stop (after they finish their work), and wait for them to stop.

      The threads are distributed across a fixed domain pool (whose size is determined by Domain.recommended_domain_count on OCaml 5, and simple the single runtime on OCaml 4).

      val size : t -> int

      Number of threads/workers.

      val num_tasks : t -> int

      Current number of tasks. This is at best a snapshot, useful for metrics and debugging.

      val shutdown : t -> unit

      Shutdown the runner and wait for it to terminate. Idempotent.

      val shutdown_without_waiting : t -> unit

      Shutdown the pool, and do not wait for it to terminate. Idempotent.

      exception Shutdown
      val run_async : t -> task -> unit

      run_async pool f schedules f for later execution on the runner in one of the threads. f() will run on one of the runner's worker threads/domains.

      • raises Shutdown

        if the runner was shut down before run_async was called.

      val run_wait_block : t -> (unit -> 'a) -> 'a

      run_wait_block pool f schedules f for later execution on the pool, like run_async. It then blocks the current thread until f() is done executing, and returns its result. If f() raises an exception, then run_wait_block pool f will raise it as well.

      NOTE be careful with deadlocks (see notes in Fut.wait_block about the required discipline to avoid deadlocks).

      module For_runner_implementors : sig ... end

      This module is specifically intended for users who implement their own runners. Regular users of Moonpool should not need to look at it.

      val get_current_runner : unit -> t option

      Access the current runner. This returns Some r if the call happens on a thread that belongs in a runner.

      • since 0.5
      val runner : t

      The trivial runner that actually runs tasks at the calling point.

      +Immediate_runner (moonpool.Moonpool.Immediate_runner)

      Module Moonpool.Immediate_runner

      Runner that runs tasks immediately in the caller thread.

      Whenever a task is submitted to this runner via Runner.run_async r task, the task is run immediately in the caller thread as task(). There are no background threads, no resource, this is just a trivial implementation of the interface.

      This can be useful when an implementation needs a runner, but there isn't enough work to justify starting an actual full thread pool.

      Another situation is when threads cannot be used at all (e.g. because you plan to call Unix.fork later).

      • since 0.5
      include module type of Runner
      type task = unit -> unit
      type t

      A runner.

      If a runner is no longer needed, shutdown can be used to signal all worker threads in it to stop (after they finish their work), and wait for them to stop.

      The threads are distributed across a fixed domain pool (whose size is determined by Domain.recommended_domain_count on OCaml 5, and simple the single runtime on OCaml 4).

      val size : t -> int

      Number of threads/workers.

      val num_tasks : t -> int

      Current number of tasks. This is at best a snapshot, useful for metrics and debugging.

      val shutdown : t -> unit

      Shutdown the runner and wait for it to terminate. Idempotent.

      val shutdown_without_waiting : t -> unit

      Shutdown the pool, and do not wait for it to terminate. Idempotent.

      exception Shutdown
      val run_async : ?name:string -> t -> task -> unit

      run_async pool f schedules f for later execution on the runner in one of the threads. f() will run on one of the runner's worker threads/domains.

      • parameter name

        if provided and Trace is present in dependencies, a span will be created when the task starts, and will stop when the task is over. (since NEXT_RELEASE)

      • raises Shutdown

        if the runner was shut down before run_async was called.

      val run_wait_block : ?name:string -> t -> (unit -> 'a) -> 'a

      run_wait_block pool f schedules f for later execution on the pool, like run_async. It then blocks the current thread until f() is done executing, and returns its result. If f() raises an exception, then run_wait_block pool f will raise it as well.

      NOTE be careful with deadlocks (see notes in Fut.wait_block about the required discipline to avoid deadlocks).

      • raises Shutdown

        if the runner was already shut down

      Implementing runners

      module For_runner_implementors : sig ... end

      This module is specifically intended for users who implement their own runners. Regular users of Moonpool should not need to look at it.

      val get_current_runner : unit -> t option

      Access the current runner. This returns Some r if the call happens on a thread that belongs in a runner.

      • since 0.5
      val runner : t

      The trivial runner that actually runs tasks at the calling point.

      diff --git a/dev/moonpool/Moonpool/Lock/index.html b/dev/moonpool/Moonpool/Lock/index.html index d2fb444b..c798743c 100644 --- a/dev/moonpool/Moonpool/Lock/index.html +++ b/dev/moonpool/Moonpool/Lock/index.html @@ -1,2 +1,2 @@ -Lock (moonpool.Moonpool.Lock)

      Module Moonpool.Lock

      Mutex-protected resource.

      • since 0.3
      type 'a t

      A value protected by a mutex

      val create : 'a -> 'a t

      Create a new protected value.

      val with_ : 'a t -> ('a -> 'b) -> 'b

      with_ l f runs f x where x is the value protected with the lock l, in a critical section. If f x fails, with_lock l f fails too but the lock is released.

      val update : 'a t -> ('a -> 'a) -> unit

      update l f replaces the content x of l with f x, while protected by the mutex.

      val update_map : 'a t -> ('a -> 'a * 'b) -> 'b

      update_map l f computes x', y = f (get l), then puts x' in l and returns y, while protected by the mutex.

      val mutex : _ t -> Stdlib.Mutex.t

      Underlying mutex.

      val get : 'a t -> 'a

      Atomically get the value in the lock. The value that is returned isn't protected!

      val set : 'a t -> 'a -> unit

      Atomically set the value.

      NOTE caution: using get and set as if this were a ref is an anti pattern and will not protect data against some race conditions.

      +Lock (moonpool.Moonpool.Lock)

      Module Moonpool.Lock

      Mutex-protected resource.

      • since 0.3
      type 'a t

      A value protected by a mutex

      val create : 'a -> 'a t

      Create a new protected value.

      val with_ : 'a t -> ('a -> 'b) -> 'b

      with_ l f runs f x where x is the value protected with the lock l, in a critical section. If f x fails, with_lock l f fails too but the lock is released.

      val update : 'a t -> ('a -> 'a) -> unit

      update l f replaces the content x of l with f x, while protected by the mutex.

      val update_map : 'a t -> ('a -> 'a * 'b) -> 'b

      update_map l f computes x', y = f (get l), then puts x' in l and returns y, while protected by the mutex.

      val mutex : _ t -> Stdlib.Mutex.t

      Underlying mutex.

      val get : 'a t -> 'a

      Atomically get the value in the lock. The value that is returned isn't protected!

      val set : 'a t -> 'a -> unit

      Atomically set the value.

      NOTE caution: using get and set as if this were a ref is an anti pattern and will not protect data against some race conditions.

      diff --git a/dev/moonpool/Moonpool/Runner/For_runner_implementors/index.html b/dev/moonpool/Moonpool/Runner/For_runner_implementors/index.html index f0906f52..1d311087 100644 --- a/dev/moonpool/Moonpool/Runner/For_runner_implementors/index.html +++ b/dev/moonpool/Moonpool/Runner/For_runner_implementors/index.html @@ -1,8 +1,8 @@ -For_runner_implementors (moonpool.Moonpool.Runner.For_runner_implementors)

      Module Runner.For_runner_implementors

      This module is specifically intended for users who implement their own runners. Regular users of Moonpool should not need to look at it.

      val create : +For_runner_implementors (moonpool.Moonpool.Runner.For_runner_implementors)

      Module Runner.For_runner_implementors

      This module is specifically intended for users who implement their own runners. Regular users of Moonpool should not need to look at it.

      val create : size:(unit -> int) -> num_tasks:(unit -> int) -> shutdown:(wait:bool -> unit -> unit) -> - run_async:(task -> unit) -> + run_async:(name:string -> task -> unit) -> unit -> - t

      Create a new runner.

      NOTE: the runner should support DLA and Suspend_ on OCaml 5.x, so that Fork_join and other 5.x features work properly.

      val k_cur_runner : t option ref Moonpool__.Thread_local_storage_.key
      + t

      Create a new runner.

      NOTE: the runner should support DLA and Suspend_ on OCaml 5.x, so that Fork_join and other 5.x features work properly.

      val k_cur_runner : t option ref Moonpool__.Thread_local_storage_.key

      Key that should be used by each runner to store itself in TLS on every thread it controls, so that tasks running on these threads can access the runner. This is necessary for get_current_runner to work.

      diff --git a/dev/moonpool/Moonpool/Runner/index.html b/dev/moonpool/Moonpool/Runner/index.html index ac22116c..eb22ca79 100644 --- a/dev/moonpool/Moonpool/Runner/index.html +++ b/dev/moonpool/Moonpool/Runner/index.html @@ -1,2 +1,2 @@ -Runner (moonpool.Moonpool.Runner)

      Module Moonpool.Runner

      Interface for runners.

      This provides an abstraction for running tasks in the background, which is implemented by various thread pools.

      • since 0.3
      type task = unit -> unit
      type t

      A runner.

      If a runner is no longer needed, shutdown can be used to signal all worker threads in it to stop (after they finish their work), and wait for them to stop.

      The threads are distributed across a fixed domain pool (whose size is determined by Domain.recommended_domain_count on OCaml 5, and simple the single runtime on OCaml 4).

      val size : t -> int

      Number of threads/workers.

      val num_tasks : t -> int

      Current number of tasks. This is at best a snapshot, useful for metrics and debugging.

      val shutdown : t -> unit

      Shutdown the runner and wait for it to terminate. Idempotent.

      val shutdown_without_waiting : t -> unit

      Shutdown the pool, and do not wait for it to terminate. Idempotent.

      exception Shutdown
      val run_async : t -> task -> unit

      run_async pool f schedules f for later execution on the runner in one of the threads. f() will run on one of the runner's worker threads/domains.

      • raises Shutdown

        if the runner was shut down before run_async was called.

      val run_wait_block : t -> (unit -> 'a) -> 'a

      run_wait_block pool f schedules f for later execution on the pool, like run_async. It then blocks the current thread until f() is done executing, and returns its result. If f() raises an exception, then run_wait_block pool f will raise it as well.

      NOTE be careful with deadlocks (see notes in Fut.wait_block about the required discipline to avoid deadlocks).

      module For_runner_implementors : sig ... end

      This module is specifically intended for users who implement their own runners. Regular users of Moonpool should not need to look at it.

      val get_current_runner : unit -> t option

      Access the current runner. This returns Some r if the call happens on a thread that belongs in a runner.

      • since 0.5
      +Runner (moonpool.Moonpool.Runner)

      Module Moonpool.Runner

      Interface for runners.

      This provides an abstraction for running tasks in the background, which is implemented by various thread pools.

      • since 0.3
      type task = unit -> unit
      type t

      A runner.

      If a runner is no longer needed, shutdown can be used to signal all worker threads in it to stop (after they finish their work), and wait for them to stop.

      The threads are distributed across a fixed domain pool (whose size is determined by Domain.recommended_domain_count on OCaml 5, and simple the single runtime on OCaml 4).

      val size : t -> int

      Number of threads/workers.

      val num_tasks : t -> int

      Current number of tasks. This is at best a snapshot, useful for metrics and debugging.

      val shutdown : t -> unit

      Shutdown the runner and wait for it to terminate. Idempotent.

      val shutdown_without_waiting : t -> unit

      Shutdown the pool, and do not wait for it to terminate. Idempotent.

      exception Shutdown
      val run_async : ?name:string -> t -> task -> unit

      run_async pool f schedules f for later execution on the runner in one of the threads. f() will run on one of the runner's worker threads/domains.

      • parameter name

        if provided and Trace is present in dependencies, a span will be created when the task starts, and will stop when the task is over. (since NEXT_RELEASE)

      • raises Shutdown

        if the runner was shut down before run_async was called.

      val run_wait_block : ?name:string -> t -> (unit -> 'a) -> 'a

      run_wait_block pool f schedules f for later execution on the pool, like run_async. It then blocks the current thread until f() is done executing, and returns its result. If f() raises an exception, then run_wait_block pool f will raise it as well.

      NOTE be careful with deadlocks (see notes in Fut.wait_block about the required discipline to avoid deadlocks).

      • raises Shutdown

        if the runner was already shut down

      Implementing runners

      module For_runner_implementors : sig ... end

      This module is specifically intended for users who implement their own runners. Regular users of Moonpool should not need to look at it.

      val get_current_runner : unit -> t option

      Access the current runner. This returns Some r if the call happens on a thread that belongs in a runner.

      • since 0.5
      diff --git a/dev/moonpool/Moonpool/Thread_local_storage/index.html b/dev/moonpool/Moonpool/Thread_local_storage/index.html index d198a88e..5ca01d98 100644 --- a/dev/moonpool/Moonpool/Thread_local_storage/index.html +++ b/dev/moonpool/Moonpool/Thread_local_storage/index.html @@ -1,2 +1,2 @@ -Thread_local_storage (moonpool.Moonpool.Thread_local_storage)

      Module Moonpool.Thread_local_storage

      Thread local storage

      type 'a key

      A TLS key for values of type 'a. This allows the storage of a single value of type 'a per thread.

      val new_key : (unit -> 'a) -> 'a key

      Allocate a new, generative key. When the key is used for the first time on a thread, the function is called to produce it.

      This should only ever be called at toplevel to produce constants, do not use it in a loop.

      val get : 'a key -> 'a

      Get the value for the current thread.

      val set : 'a key -> 'a -> unit

      Set the value for the current thread.

      +Thread_local_storage (moonpool.Moonpool.Thread_local_storage)

      Module Moonpool.Thread_local_storage

      Thread local storage

      type 'a key

      A TLS key for values of type 'a. This allows the storage of a single value of type 'a per thread.

      val new_key : (unit -> 'a) -> 'a key

      Allocate a new, generative key. When the key is used for the first time on a thread, the function is called to produce it.

      This should only ever be called at toplevel to produce constants, do not use it in a loop.

      val get : 'a key -> 'a

      Get the value for the current thread.

      val set : 'a key -> 'a -> unit

      Set the value for the current thread.

      diff --git a/dev/moonpool/Moonpool/Ws_pool/For_runner_implementors/index.html b/dev/moonpool/Moonpool/Ws_pool/For_runner_implementors/index.html index d4cd3e8a..d7deaa26 100644 --- a/dev/moonpool/Moonpool/Ws_pool/For_runner_implementors/index.html +++ b/dev/moonpool/Moonpool/Ws_pool/For_runner_implementors/index.html @@ -1,8 +1,8 @@ -For_runner_implementors (moonpool.Moonpool.Ws_pool.For_runner_implementors)

      Module Ws_pool.For_runner_implementors

      This module is specifically intended for users who implement their own runners. Regular users of Moonpool should not need to look at it.

      val create : +For_runner_implementors (moonpool.Moonpool.Ws_pool.For_runner_implementors)

      Module Ws_pool.For_runner_implementors

      This module is specifically intended for users who implement their own runners. Regular users of Moonpool should not need to look at it.

      val create : size:(unit -> int) -> num_tasks:(unit -> int) -> shutdown:(wait:bool -> unit -> unit) -> - run_async:(task -> unit) -> + run_async:(name:string -> task -> unit) -> unit -> - t

      Create a new runner.

      NOTE: the runner should support DLA and Suspend_ on OCaml 5.x, so that Fork_join and other 5.x features work properly.

      val k_cur_runner : t option ref Moonpool__.Thread_local_storage_.key
      + t

      Create a new runner.

      NOTE: the runner should support DLA and Suspend_ on OCaml 5.x, so that Fork_join and other 5.x features work properly.

      val k_cur_runner : t option ref Moonpool__.Thread_local_storage_.key

      Key that should be used by each runner to store itself in TLS on every thread it controls, so that tasks running on these threads can access the runner. This is necessary for get_current_runner to work.

      diff --git a/dev/moonpool/Moonpool/Ws_pool/index.html b/dev/moonpool/Moonpool/Ws_pool/index.html index 84568d93..c29f33e6 100644 --- a/dev/moonpool/Moonpool/Ws_pool/index.html +++ b/dev/moonpool/Moonpool/Ws_pool/index.html @@ -1,8 +1,8 @@ -Ws_pool (moonpool.Moonpool.Ws_pool)

      Module Moonpool.Ws_pool

      Work-stealing thread pool.

      A pool of threads with a worker-stealing scheduler. The pool contains a fixed number of threads that wait for work items to come, process these, and loop.

      This is good for CPU-intensive tasks that feature a lot of small tasks. Note that tasks will not always be processed in the order they are scheduled, so this is not great for workloads where the latency of individual tasks matter (for that see Fifo_pool).

      This implements Runner.t since 0.3.

      If a pool is no longer needed, shutdown can be used to signal all threads in it to stop (after they finish their work), and wait for them to stop.

      The threads are distributed across a fixed domain pool (whose size is determined by Domain.recommended_domain_count on OCaml 5, and simply the single runtime on OCaml 4).

      include module type of Runner
      type task = unit -> unit
      type t

      A runner.

      If a runner is no longer needed, shutdown can be used to signal all worker threads in it to stop (after they finish their work), and wait for them to stop.

      The threads are distributed across a fixed domain pool (whose size is determined by Domain.recommended_domain_count on OCaml 5, and simple the single runtime on OCaml 4).

      val size : t -> int

      Number of threads/workers.

      val num_tasks : t -> int

      Current number of tasks. This is at best a snapshot, useful for metrics and debugging.

      val shutdown : t -> unit

      Shutdown the runner and wait for it to terminate. Idempotent.

      val shutdown_without_waiting : t -> unit

      Shutdown the pool, and do not wait for it to terminate. Idempotent.

      exception Shutdown
      val run_async : t -> task -> unit

      run_async pool f schedules f for later execution on the runner in one of the threads. f() will run on one of the runner's worker threads/domains.

      • raises Shutdown

        if the runner was shut down before run_async was called.

      val run_wait_block : t -> (unit -> 'a) -> 'a

      run_wait_block pool f schedules f for later execution on the pool, like run_async. It then blocks the current thread until f() is done executing, and returns its result. If f() raises an exception, then run_wait_block pool f will raise it as well.

      NOTE be careful with deadlocks (see notes in Fut.wait_block about the required discipline to avoid deadlocks).

      module For_runner_implementors : sig ... end

      This module is specifically intended for users who implement their own runners. Regular users of Moonpool should not need to look at it.

      val get_current_runner : unit -> t option

      Access the current runner. This returns Some r if the call happens on a thread that belongs in a runner.

      • since 0.5
      type ('a, 'b) create_args = +Ws_pool (moonpool.Moonpool.Ws_pool)

      Module Moonpool.Ws_pool

      Work-stealing thread pool.

      A pool of threads with a worker-stealing scheduler. The pool contains a fixed number of threads that wait for work items to come, process these, and loop.

      This is good for CPU-intensive tasks that feature a lot of small tasks. Note that tasks will not always be processed in the order they are scheduled, so this is not great for workloads where the latency of individual tasks matter (for that see Fifo_pool).

      This implements Runner.t since 0.3.

      If a pool is no longer needed, shutdown can be used to signal all threads in it to stop (after they finish their work), and wait for them to stop.

      The threads are distributed across a fixed domain pool (whose size is determined by Domain.recommended_domain_count on OCaml 5, and simply the single runtime on OCaml 4).

      include module type of Runner
      type task = unit -> unit
      type t

      A runner.

      If a runner is no longer needed, shutdown can be used to signal all worker threads in it to stop (after they finish their work), and wait for them to stop.

      The threads are distributed across a fixed domain pool (whose size is determined by Domain.recommended_domain_count on OCaml 5, and simple the single runtime on OCaml 4).

      val size : t -> int

      Number of threads/workers.

      val num_tasks : t -> int

      Current number of tasks. This is at best a snapshot, useful for metrics and debugging.

      val shutdown : t -> unit

      Shutdown the runner and wait for it to terminate. Idempotent.

      val shutdown_without_waiting : t -> unit

      Shutdown the pool, and do not wait for it to terminate. Idempotent.

      exception Shutdown
      val run_async : ?name:string -> t -> task -> unit

      run_async pool f schedules f for later execution on the runner in one of the threads. f() will run on one of the runner's worker threads/domains.

      • parameter name

        if provided and Trace is present in dependencies, a span will be created when the task starts, and will stop when the task is over. (since NEXT_RELEASE)

      • raises Shutdown

        if the runner was shut down before run_async was called.

      val run_wait_block : ?name:string -> t -> (unit -> 'a) -> 'a

      run_wait_block pool f schedules f for later execution on the pool, like run_async. It then blocks the current thread until f() is done executing, and returns its result. If f() raises an exception, then run_wait_block pool f will raise it as well.

      NOTE be careful with deadlocks (see notes in Fut.wait_block about the required discipline to avoid deadlocks).

      • raises Shutdown

        if the runner was already shut down

      Implementing runners

      module For_runner_implementors : sig ... end

      This module is specifically intended for users who implement their own runners. Regular users of Moonpool should not need to look at it.

      val get_current_runner : unit -> t option

      Access the current runner. This returns Some r if the call happens on a thread that belongs in a runner.

      • since 0.5
      type ('a, 'b) create_args = ?on_init_thread:(dom_id:int -> t_id:int -> unit -> unit) -> ?on_exit_thread:(dom_id:int -> t_id:int -> unit -> unit) -> ?on_exn:(exn -> Stdlib.Printexc.raw_backtrace -> unit) -> ?around_task:((t -> 'b) * (t -> 'b -> unit)) -> ?num_threads:int -> - 'a

      Arguments used in create. See create for explanations.

      val create : (unit -> t, _) create_args

      create () makes a new thread pool.

      • parameter on_init_thread

        called at the beginning of each new thread in the pool.

      • parameter num_threads

        size of the pool, ie. number of worker threads. It will be at least 1 internally, so 0 or negative values make no sense. The default is Domain.recommended_domain_count(), ie one worker thread per CPU core. On OCaml 4 the default is 4 (since there is only one domain).

      • parameter on_exit_thread

        called at the end of each thread in the pool

      • parameter around_task

        a pair of before, after, where before pool is called before a task is processed, on the worker thread about to run it, and returns x; and after pool x is called by the same thread after the task is over. (since 0.2)

      val with_ : (unit -> (t -> 'a) -> 'a, _) create_args

      with_ () f calls f pool, where pool is obtained via create. When f pool returns or fails, pool is shutdown and its resources are released.

      Most parameters are the same as in create.

      • since 0.3
      val run : t -> (unit -> unit) -> unit

      deprecated alias to run_async

      • deprecated use run_async
      + 'a

      Arguments used in create. See create for explanations.

      val create : (unit -> t, _) create_args

      create () makes a new thread pool.

      • parameter on_init_thread

        called at the beginning of each new thread in the pool.

      • parameter num_threads

        size of the pool, ie. number of worker threads. It will be at least 1 internally, so 0 or negative values make no sense. The default is Domain.recommended_domain_count(), ie one worker thread per CPU core. On OCaml 4 the default is 4 (since there is only one domain).

      • parameter on_exit_thread

        called at the end of each thread in the pool

      • parameter around_task

        a pair of before, after, where before pool is called before a task is processed, on the worker thread about to run it, and returns x; and after pool x is called by the same thread after the task is over. (since 0.2)

      val with_ : (unit -> (t -> 'a) -> 'a, _) create_args

      with_ () f calls f pool, where pool is obtained via create. When f pool returns or fails, pool is shutdown and its resources are released.

      Most parameters are the same as in create.

      • since 0.3
      diff --git a/dev/moonpool/Moonpool/index.html b/dev/moonpool/Moonpool/index.html index 23272796..9896b27d 100644 --- a/dev/moonpool/Moonpool/index.html +++ b/dev/moonpool/Moonpool/index.html @@ -1,2 +1,2 @@ -Moonpool (moonpool.Moonpool)

      Module Moonpool

      Moonpool

      A pool within a bigger pool (ie the ocean). Here, we're talking about pools of Thread.t that are dispatched over several Domain.t to enable parallelism.

      We provide several implementations of pools with distinct scheduling strategies, alongside some concurrency primitives such as guarding locks (Lock.t) and futures (Fut.t).

      module Ws_pool : sig ... end

      Work-stealing thread pool.

      module Fifo_pool : sig ... end

      A simple thread pool in FIFO order.

      module Runner : sig ... end

      Interface for runners.

      module Immediate_runner : sig ... end

      Runner that runs tasks immediately in the caller thread.

      module Pool = Fifo_pool

      Default pool. Please explicitly pick an implementation instead.

      val start_thread_on_some_domain : ('a -> unit) -> 'a -> Thread.t

      Similar to Thread.create, but it picks a background domain at random to run the thread. This ensures that we don't always pick the same domain to run all the various threads needed in an application (timers, event loops, etc.)

      val run_async : Runner.t -> (unit -> unit) -> unit

      run_async runner task schedules the task to run on the given runner. This means task() will be executed at some point in the future, possibly in another thread.

      • since 0.5

      Number of threads recommended to saturate the CPU. For IO pools this makes little sense (you might want more threads than this because many of them will be blocked most of the time).

      • since 0.5
      val spawn : on:Runner.t -> (unit -> 'a) -> 'a Fut.t

      spawn ~on f runs f() on the runner (a thread pool typically) and returns a future result for it. See Fut.spawn.

      • since 0.5
      val spawn_on_current_runner : (unit -> 'a) -> 'a Fut.t
      val await : 'a Fut.t -> 'a

      Await a future. See await. Only on OCaml >= 5.0.

      • since 0.5
      module Lock : sig ... end

      Mutex-protected resource.

      module Fut : sig ... end

      Futures.

      module Chan : sig ... end

      Channels.

      module Fork_join : sig ... end

      Fork-join primitives.

      module Thread_local_storage : sig ... end

      Thread local storage

      module Blocking_queue : sig ... end

      A simple blocking queue.

      module Bounded_queue : sig ... end

      A blocking queue of finite size.

      module Atomic : sig ... end

      Atomic values.

      +Moonpool (moonpool.Moonpool)

      Module Moonpool

      Moonpool

      A pool within a bigger pool (ie the ocean). Here, we're talking about pools of Thread.t that are dispatched over several Domain.t to enable parallelism.

      We provide several implementations of pools with distinct scheduling strategies, alongside some concurrency primitives such as guarding locks (Lock.t) and futures (Fut.t).

      module Ws_pool : sig ... end

      Work-stealing thread pool.

      module Fifo_pool : sig ... end

      A simple thread pool in FIFO order.

      module Runner : sig ... end

      Interface for runners.

      module Immediate_runner : sig ... end

      Runner that runs tasks immediately in the caller thread.

      module Pool = Fifo_pool

      Default pool. Please explicitly pick an implementation instead.

      val start_thread_on_some_domain : ('a -> unit) -> 'a -> Thread.t

      Similar to Thread.create, but it picks a background domain at random to run the thread. This ensures that we don't always pick the same domain to run all the various threads needed in an application (timers, event loops, etc.)

      val run_async : ?name:string -> Runner.t -> (unit -> unit) -> unit

      run_async runner task schedules the task to run on the given runner. This means task() will be executed at some point in the future, possibly in another thread.

      • parameter name

        if provided and Trace is present in dependencies, a span will be created when the task starts, and will stop when the task is over. (since NEXT_RELEASE)

      • since 0.5

      Number of threads recommended to saturate the CPU. For IO pools this makes little sense (you might want more threads than this because many of them will be blocked most of the time).

      • since 0.5
      val spawn : ?name:string -> on:Runner.t -> (unit -> 'a) -> 'a Fut.t

      spawn ~on f runs f() on the runner (a thread pool typically) and returns a future result for it. See Fut.spawn.

      • parameter name

        if provided and Trace is present in dependencies, a span will be created for the future. (since NEXT_RELEASE)

      • since 0.5
      val spawn_on_current_runner : ?name:string -> (unit -> 'a) -> 'a Fut.t

      See Fut.spawn_on_current_runner.

      • parameter name

        see spawn. since NEXT_RELEASE.

      • since 0.5
      val await : 'a Fut.t -> 'a

      Await a future. See await. Only on OCaml >= 5.0.

      • since 0.5
      module Lock : sig ... end

      Mutex-protected resource.

      module Fut : sig ... end

      Futures.

      module Chan : sig ... end

      Channels.

      module Fork_join : sig ... end

      Fork-join primitives.

      module Thread_local_storage : sig ... end

      Thread local storage

      module Blocking_queue : sig ... end

      A simple blocking queue.

      module Bounded_queue : sig ... end

      A blocking queue of finite size.

      module Atomic : sig ... end

      Atomic values.

      diff --git a/dev/moonpool/Moonpool__/index.html b/dev/moonpool/Moonpool__/index.html new file mode 100644 index 00000000..90ecee23 --- /dev/null +++ b/dev/moonpool/Moonpool__/index.html @@ -0,0 +1,2 @@ + +Moonpool__ (moonpool.Moonpool__)

      Module Moonpool__

      This module is hidden.

      diff --git a/dev/moonpool/Moonpool__Atomic_/index.html b/dev/moonpool/Moonpool__Atomic_/index.html new file mode 100644 index 00000000..4e3ab443 --- /dev/null +++ b/dev/moonpool/Moonpool__Atomic_/index.html @@ -0,0 +1,2 @@ + +Moonpool__Atomic_ (moonpool.Moonpool__Atomic_)

      Module Moonpool__Atomic_

      This module is hidden.

      diff --git a/dev/moonpool/Moonpool__Bb_queue/index.html b/dev/moonpool/Moonpool__Bb_queue/index.html new file mode 100644 index 00000000..3722a663 --- /dev/null +++ b/dev/moonpool/Moonpool__Bb_queue/index.html @@ -0,0 +1,2 @@ + +Moonpool__Bb_queue (moonpool.Moonpool__Bb_queue)

      Module Moonpool__Bb_queue

      This module is hidden.

      diff --git a/dev/moonpool/Moonpool__Bounded_queue/index.html b/dev/moonpool/Moonpool__Bounded_queue/index.html new file mode 100644 index 00000000..673b7e6b --- /dev/null +++ b/dev/moonpool/Moonpool__Bounded_queue/index.html @@ -0,0 +1,2 @@ + +Moonpool__Bounded_queue (moonpool.Moonpool__Bounded_queue)

      Module Moonpool__Bounded_queue

      This module is hidden.

      diff --git a/dev/moonpool/Moonpool__Chan/index.html b/dev/moonpool/Moonpool__Chan/index.html new file mode 100644 index 00000000..02ba17d3 --- /dev/null +++ b/dev/moonpool/Moonpool__Chan/index.html @@ -0,0 +1,2 @@ + +Moonpool__Chan (moonpool.Moonpool__Chan)

      Module Moonpool__Chan

      This module is hidden.

      diff --git a/dev/moonpool/Moonpool__Domain_/index.html b/dev/moonpool/Moonpool__Domain_/index.html new file mode 100644 index 00000000..637f6af3 --- /dev/null +++ b/dev/moonpool/Moonpool__Domain_/index.html @@ -0,0 +1,2 @@ + +Moonpool__Domain_ (moonpool.Moonpool__Domain_)

      Module Moonpool__Domain_

      This module is hidden.

      diff --git a/dev/moonpool/Moonpool__Fifo_pool/index.html b/dev/moonpool/Moonpool__Fifo_pool/index.html new file mode 100644 index 00000000..a0e160ae --- /dev/null +++ b/dev/moonpool/Moonpool__Fifo_pool/index.html @@ -0,0 +1,2 @@ + +Moonpool__Fifo_pool (moonpool.Moonpool__Fifo_pool)

      Module Moonpool__Fifo_pool

      This module is hidden.

      diff --git a/dev/moonpool/Moonpool__Fork_join/index.html b/dev/moonpool/Moonpool__Fork_join/index.html new file mode 100644 index 00000000..c81785ed --- /dev/null +++ b/dev/moonpool/Moonpool__Fork_join/index.html @@ -0,0 +1,2 @@ + +Moonpool__Fork_join (moonpool.Moonpool__Fork_join)

      Module Moonpool__Fork_join

      This module is hidden.

      diff --git a/dev/moonpool/Moonpool__Fut/index.html b/dev/moonpool/Moonpool__Fut/index.html new file mode 100644 index 00000000..2f5c3b6e --- /dev/null +++ b/dev/moonpool/Moonpool__Fut/index.html @@ -0,0 +1,2 @@ + +Moonpool__Fut (moonpool.Moonpool__Fut)

      Module Moonpool__Fut

      This module is hidden.

      diff --git a/dev/moonpool/Moonpool__Immediate_runner/index.html b/dev/moonpool/Moonpool__Immediate_runner/index.html new file mode 100644 index 00000000..6b7ebfd3 --- /dev/null +++ b/dev/moonpool/Moonpool__Immediate_runner/index.html @@ -0,0 +1,2 @@ + +Moonpool__Immediate_runner (moonpool.Moonpool__Immediate_runner)

      Module Moonpool__Immediate_runner

      This module is hidden.

      diff --git a/dev/moonpool/Moonpool__Lock/index.html b/dev/moonpool/Moonpool__Lock/index.html new file mode 100644 index 00000000..a275e182 --- /dev/null +++ b/dev/moonpool/Moonpool__Lock/index.html @@ -0,0 +1,2 @@ + +Moonpool__Lock (moonpool.Moonpool__Lock)

      Module Moonpool__Lock

      This module is hidden.

      diff --git a/dev/moonpool/Moonpool__Runner/index.html b/dev/moonpool/Moonpool__Runner/index.html new file mode 100644 index 00000000..97b27675 --- /dev/null +++ b/dev/moonpool/Moonpool__Runner/index.html @@ -0,0 +1,2 @@ + +Moonpool__Runner (moonpool.Moonpool__Runner)

      Module Moonpool__Runner

      This module is hidden.

      diff --git a/dev/moonpool/Moonpool__Suspend_/index.html b/dev/moonpool/Moonpool__Suspend_/index.html new file mode 100644 index 00000000..e6605b01 --- /dev/null +++ b/dev/moonpool/Moonpool__Suspend_/index.html @@ -0,0 +1,2 @@ + +Moonpool__Suspend_ (moonpool.Moonpool__Suspend_)

      Module Moonpool__Suspend_

      This module is hidden.

      diff --git a/dev/moonpool/Moonpool__Thread_local_storage_/index.html b/dev/moonpool/Moonpool__Thread_local_storage_/index.html new file mode 100644 index 00000000..6ae7a4cc --- /dev/null +++ b/dev/moonpool/Moonpool__Thread_local_storage_/index.html @@ -0,0 +1,2 @@ + +Moonpool__Thread_local_storage_ (moonpool.Moonpool__Thread_local_storage_)

      Module Moonpool__Thread_local_storage_

      This module is hidden.

      diff --git a/dev/moonpool/Moonpool__Util_pool_/index.html b/dev/moonpool/Moonpool__Util_pool_/index.html new file mode 100644 index 00000000..b95889d1 --- /dev/null +++ b/dev/moonpool/Moonpool__Util_pool_/index.html @@ -0,0 +1,2 @@ + +Moonpool__Util_pool_ (moonpool.Moonpool__Util_pool_)

      Module Moonpool__Util_pool_

      This module is hidden.

      diff --git a/dev/moonpool/Moonpool__Ws_deque_/index.html b/dev/moonpool/Moonpool__Ws_deque_/index.html new file mode 100644 index 00000000..ffb49ac3 --- /dev/null +++ b/dev/moonpool/Moonpool__Ws_deque_/index.html @@ -0,0 +1,2 @@ + +Moonpool__Ws_deque_ (moonpool.Moonpool__Ws_deque_)

      Module Moonpool__Ws_deque_

      This module is hidden.

      diff --git a/dev/moonpool/Moonpool__Ws_pool/index.html b/dev/moonpool/Moonpool__Ws_pool/index.html new file mode 100644 index 00000000..ede0a9ba --- /dev/null +++ b/dev/moonpool/Moonpool__Ws_pool/index.html @@ -0,0 +1,2 @@ + +Moonpool__Ws_pool (moonpool.Moonpool__Ws_pool)

      Module Moonpool__Ws_pool

      This module is hidden.

      diff --git a/dev/moonpool/index.html b/dev/moonpool/index.html index 84510f49..5d306dfb 100644 --- a/dev/moonpool/index.html +++ b/dev/moonpool/index.html @@ -1,2 +1,2 @@ -index (moonpool.index)

      Package moonpool

      Package info

      changes-files
      readme-files
      +index (moonpool.index)

      Package moonpool

      Package info

      changes-files
      readme-files
      diff --git a/dev/ocaml/Afl_instrument/index.html b/dev/ocaml/Afl_instrument/index.html index 3765179b..6aa2470b 100644 --- a/dev/ocaml/Afl_instrument/index.html +++ b/dev/ocaml/Afl_instrument/index.html @@ -1,5 +1,5 @@ -Afl_instrument (ocaml.Afl_instrument)

      Module Afl_instrument

      Instrumentation for afl-fuzz.

      val instrument_function : Cmm.expression -> Debuginfo.t -> Cmm.expression
      val instrument_initialiser : +Afl_instrument (ocaml.Afl_instrument)

      Module Afl_instrument

      Instrumentation for afl-fuzz.

      val instrument_function : Cmm.expression -> Debuginfo.t -> Cmm.expression
      val instrument_initialiser : Cmm.expression -> (unit -> Debuginfo.t) -> Cmm.expression
      diff --git a/dev/ocaml/Alias_analysis/index.html b/dev/ocaml/Alias_analysis/index.html index 2fc87613..4d7960ec 100644 --- a/dev/ocaml/Alias_analysis/index.html +++ b/dev/ocaml/Alias_analysis/index.html @@ -1,5 +1,5 @@ -Alias_analysis (ocaml.Alias_analysis)

      Module Alias_analysis

      type allocation_point =
      1. | Symbol of Symbol.t
      2. | Variable of Variable.t
      type allocated_const =
      1. | Normal of Allocated_const.t
      2. | Array of Lambda.array_kind * Asttypes.mutable_flag * Variable.t list
      3. | Duplicate_array of Lambda.array_kind * Asttypes.mutable_flag * Variable.t
      type constant_defining_value =
      1. | Allocated_const of allocated_const
      2. | Block of Tag.t * Variable.t list
      3. | Set_of_closures of Flambda.set_of_closures
      4. | Project_closure of Flambda.project_closure
      5. | Move_within_set_of_closures of Flambda.move_within_set_of_closures
      6. | Project_var of Flambda.project_var
      7. | Field of Variable.t * int
      8. | Symbol_field of Symbol.t * int
      9. | Const of Flambda.const
      10. | Symbol of Symbol.t
      11. | Variable of Variable.t
      type initialize_symbol_field = Variable.t option
      val run : +Alias_analysis (ocaml.Alias_analysis)

      Module Alias_analysis

      type allocation_point =
      1. | Symbol of Symbol.t
      2. | Variable of Variable.t
      type allocated_const =
      1. | Normal of Allocated_const.t
      2. | Array of Lambda.array_kind * Asttypes.mutable_flag * Variable.t list
      3. | Duplicate_array of Lambda.array_kind * Asttypes.mutable_flag * Variable.t
      type constant_defining_value =
      1. | Allocated_const of allocated_const
      2. | Block of Tag.t * Variable.t list
      3. | Set_of_closures of Flambda.set_of_closures
      4. | Project_closure of Flambda.project_closure
      5. | Move_within_set_of_closures of Flambda.move_within_set_of_closures
      6. | Project_var of Flambda.project_var
      7. | Field of Variable.t * int
      8. | Symbol_field of Symbol.t * int
      9. | Const of Flambda.const
      10. | Symbol of Symbol.t
      11. | Variable of Variable.t
      type initialize_symbol_field = Variable.t option
      val run : constant_defining_value Variable.Tbl.t -> initialize_symbol_field list Symbol.Tbl.t -> Flambda.constant_defining_value Symbol.Tbl.t -> diff --git a/dev/ocaml/Allocated_const/index.html b/dev/ocaml/Allocated_const/index.html index d73fdf37..a8aed038 100644 --- a/dev/ocaml/Allocated_const/index.html +++ b/dev/ocaml/Allocated_const/index.html @@ -1,2 +1,2 @@ -Allocated_const (ocaml.Allocated_const)

      Module Allocated_const

      Constants that are always allocated (possibly statically). Blocks are not included here since they are always encoded using Prim (Pmakeblock, ...).

      type t =
      1. | Float of float
      2. | Int32 of int32
      3. | Int64 of int64
      4. | Nativeint of nativeint
      5. | Float_array of float list
      6. | Immutable_float_array of float list
      7. | String of string
      8. | Immutable_string of string
      val compare_floats : float -> float -> int
      val compare : t -> t -> int
      val print : Stdlib.Format.formatter -> t -> unit
      +Allocated_const (ocaml.Allocated_const)

      Module Allocated_const

      Constants that are always allocated (possibly statically). Blocks are not included here since they are always encoded using Prim (Pmakeblock, ...).

      type t =
      1. | Float of float
      2. | Int32 of int32
      3. | Int64 of int64
      4. | Nativeint of nativeint
      5. | Float_array of float list
      6. | Immutable_float_array of float list
      7. | String of string
      8. | Immutable_string of string
      val compare_floats : float -> float -> int
      val compare : t -> t -> int
      val print : Stdlib.Format.formatter -> t -> unit
      diff --git a/dev/ocaml/Annot/index.html b/dev/ocaml/Annot/index.html index 628b5db8..59bac179 100644 --- a/dev/ocaml/Annot/index.html +++ b/dev/ocaml/Annot/index.html @@ -1,2 +1,2 @@ -Annot (ocaml.Annot)

      Module Annot

      type call =
      1. | Tail
      2. | Stack
      3. | Inline
      type ident =
      1. | Iref_internal of Location.t
      2. | Iref_external
      3. | Idef of Location.t
      +Annot (ocaml.Annot)

      Module Annot

      type call =
      1. | Tail
      2. | Stack
      3. | Inline
      type ident =
      1. | Iref_internal of Location.t
      2. | Iref_external
      3. | Idef of Location.t
      diff --git a/dev/ocaml/Arch/index.html b/dev/ocaml/Arch/index.html index 624b8f23..62757646 100644 --- a/dev/ocaml/Arch/index.html +++ b/dev/ocaml/Arch/index.html @@ -1,5 +1,5 @@ -Arch (ocaml.Arch)

      Module Arch

      val command_line_options : (string * Stdlib.Arg.spec * string) list
      type addressing_mode =
      1. | Ibased of string * int
      2. | Iindexed of int
      3. | Iindexed2 of int
      4. | Iscaled of int * int
      5. | Iindexed2scaled of int * int
      type specific_operation =
      1. | Ilea of addressing_mode
      2. | Istore_int of nativeint * addressing_mode * bool
      3. | Ioffset_loc of int * addressing_mode
      4. | Ifloatarithmem of float_operation * addressing_mode
      5. | Ibswap of int
      6. | Isqrtf
      7. | Ifloatsqrtf of addressing_mode
      8. | Isextend32
      9. | Izextend32
      and float_operation =
      1. | Ifloatadd
      2. | Ifloatsub
      3. | Ifloatmul
      4. | Ifloatdiv
      val big_endian : bool
      val size_addr : int
      val size_int : int
      val size_float : int
      val allow_unaligned_access : bool
      val division_crashes_on_overflow : bool
      val identity_addressing : addressing_mode
      val offset_addressing : addressing_mode -> int -> addressing_mode
      val num_args_addressing : addressing_mode -> int
      val print_addressing : +Arch (ocaml.Arch)

      Module Arch

      val command_line_options : (string * Stdlib.Arg.spec * string) list
      type addressing_mode =
      1. | Ibased of string * int
      2. | Iindexed of int
      3. | Iindexed2 of int
      4. | Iscaled of int * int
      5. | Iindexed2scaled of int * int
      type specific_operation =
      1. | Ilea of addressing_mode
      2. | Istore_int of nativeint * addressing_mode * bool
      3. | Ioffset_loc of int * addressing_mode
      4. | Ifloatarithmem of float_operation * addressing_mode
      5. | Ibswap of int
      6. | Isqrtf
      7. | Ifloatsqrtf of addressing_mode
      8. | Isextend32
      9. | Izextend32
      and float_operation =
      1. | Ifloatadd
      2. | Ifloatsub
      3. | Ifloatmul
      4. | Ifloatdiv
      val big_endian : bool
      val size_addr : int
      val size_int : int
      val size_float : int
      val allow_unaligned_access : bool
      val division_crashes_on_overflow : bool
      val identity_addressing : addressing_mode
      val offset_addressing : addressing_mode -> int -> addressing_mode
      val num_args_addressing : addressing_mode -> int
      val print_addressing : (Stdlib.Format.formatter -> 'a -> unit) -> addressing_mode -> Stdlib.Format.formatter -> diff --git a/dev/ocaml/Arg_helper/Make/argument-1-S/Key/Map/index.html b/dev/ocaml/Arg_helper/Make/argument-1-S/Key/Map/index.html index 9ea23b1c..9b9d81c7 100644 --- a/dev/ocaml/Arg_helper/Make/argument-1-S/Key/Map/index.html +++ b/dev/ocaml/Arg_helper/Make/argument-1-S/Key/Map/index.html @@ -1,5 +1,5 @@ -Map (ocaml.Arg_helper.Make.S.Key.Map)

      Module Key.Map

      type key = t

      The type of the map keys.

      type !+'a t

      The type of maps from type key to type 'a.

      val empty : 'a t

      The empty map.

      val is_empty : 'a t -> bool

      Test whether a map is empty or not.

      val mem : key -> 'a t -> bool

      mem x m returns true if m contains a binding for x, and false otherwise.

      val add : key -> 'a -> 'a t -> 'a t

      add key data m returns a map containing the same bindings as m, plus a binding of key to data. If key was already bound in m to a value that is physically equal to data, m is returned unchanged (the result of the function is then physically equal to m). Otherwise, the previous binding of key in m disappears.

      • before 4.03

        Physical equality was not ensured.

      val update : key -> ('a option -> 'a option) -> 'a t -> 'a t

      update key f m returns a map containing the same bindings as m, except for the binding of key. Depending on the value of y where y is f (find_opt key m), the binding of key is added, removed or updated. If y is None, the binding is removed if it exists; otherwise, if y is Some z then key is associated to z in the resulting map. If key was already bound in m to a value that is physically equal to z, m is returned unchanged (the result of the function is then physically equal to m).

      • since 4.06.0
      val singleton : key -> 'a -> 'a t

      singleton x y returns the one-element map that contains a binding y for x.

      • since 3.12.0
      val remove : key -> 'a t -> 'a t

      remove x m returns a map containing the same bindings as m, except for x which is unbound in the returned map. If x was not in m, m is returned unchanged (the result of the function is then physically equal to m).

      • before 4.03

        Physical equality was not ensured.

      val merge : +Map (ocaml.Arg_helper.Make.S.Key.Map)

      Module Key.Map

      type key = t

      The type of the map keys.

      type !+'a t

      The type of maps from type key to type 'a.

      val empty : 'a t

      The empty map.

      val is_empty : 'a t -> bool

      Test whether a map is empty or not.

      val mem : key -> 'a t -> bool

      mem x m returns true if m contains a binding for x, and false otherwise.

      val add : key -> 'a -> 'a t -> 'a t

      add key data m returns a map containing the same bindings as m, plus a binding of key to data. If key was already bound in m to a value that is physically equal to data, m is returned unchanged (the result of the function is then physically equal to m). Otherwise, the previous binding of key in m disappears.

      • before 4.03

        Physical equality was not ensured.

      val update : key -> ('a option -> 'a option) -> 'a t -> 'a t

      update key f m returns a map containing the same bindings as m, except for the binding of key. Depending on the value of y where y is f (find_opt key m), the binding of key is added, removed or updated. If y is None, the binding is removed if it exists; otherwise, if y is Some z then key is associated to z in the resulting map. If key was already bound in m to a value that is physically equal to z, m is returned unchanged (the result of the function is then physically equal to m).

      • since 4.06.0
      val singleton : key -> 'a -> 'a t

      singleton x y returns the one-element map that contains a binding y for x.

      • since 3.12.0
      val remove : key -> 'a t -> 'a t

      remove x m returns a map containing the same bindings as m, except for x which is unbound in the returned map. If x was not in m, m is returned unchanged (the result of the function is then physically equal to m).

      • before 4.03

        Physical equality was not ensured.

      val merge : (key -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> diff --git a/dev/ocaml/Arg_helper/Make/argument-1-S/Key/index.html b/dev/ocaml/Arg_helper/Make/argument-1-S/Key/index.html index 4594a667..5ebe3867 100644 --- a/dev/ocaml/Arg_helper/Make/argument-1-S/Key/index.html +++ b/dev/ocaml/Arg_helper/Make/argument-1-S/Key/index.html @@ -1,2 +1,2 @@ -Key (ocaml.Arg_helper.Make.S.Key)

      Module S.Key

      type t
      val of_string : string -> t

      The textual representation of a key must not contain '=' or ','.

      module Map : Map.S with type key = t
      +Key (ocaml.Arg_helper.Make.S.Key)

      Module S.Key

      type t
      val of_string : string -> t

      The textual representation of a key must not contain '=' or ','.

      module Map : Map.S with type key = t
      diff --git a/dev/ocaml/Arg_helper/Make/argument-1-S/Value/index.html b/dev/ocaml/Arg_helper/Make/argument-1-S/Value/index.html index 906d874b..5748a7df 100644 --- a/dev/ocaml/Arg_helper/Make/argument-1-S/Value/index.html +++ b/dev/ocaml/Arg_helper/Make/argument-1-S/Value/index.html @@ -1,2 +1,2 @@ -Value (ocaml.Arg_helper.Make.S.Value)

      Module S.Value

      type t
      val of_string : string -> t

      The textual representation of a value must not contain ','.

      +Value (ocaml.Arg_helper.Make.S.Value)

      Module S.Value

      type t
      val of_string : string -> t

      The textual representation of a value must not contain ','.

      diff --git a/dev/ocaml/Arg_helper/Make/argument-1-S/index.html b/dev/ocaml/Arg_helper/Make/argument-1-S/index.html index e102282e..3b2e3dc1 100644 --- a/dev/ocaml/Arg_helper/Make/argument-1-S/index.html +++ b/dev/ocaml/Arg_helper/Make/argument-1-S/index.html @@ -1,2 +1,2 @@ -S (ocaml.Arg_helper.Make.S)

      Parameter Make.S

      module Key : sig ... end
      module Value : sig ... end
      +S (ocaml.Arg_helper.Make.S)

      Parameter Make.S

      module Key : sig ... end
      module Value : sig ... end
      diff --git a/dev/ocaml/Arg_helper/Make/index.html b/dev/ocaml/Arg_helper/Make/index.html index 46d422d2..5d608895 100644 --- a/dev/ocaml/Arg_helper/Make/index.html +++ b/dev/ocaml/Arg_helper/Make/index.html @@ -1,2 +1,2 @@ -Make (ocaml.Arg_helper.Make)

      Module Arg_helper.Make

      Parameters

      module S : sig ... end

      Signature

      type parsed
      val default : S.Value.t -> parsed
      val set_base_default : S.Value.t -> parsed -> parsed
      val add_base_override : S.Key.t -> S.Value.t -> parsed -> parsed
      val reset_base_overrides : parsed -> parsed
      val set_user_default : S.Value.t -> parsed -> parsed
      val add_user_override : S.Key.t -> S.Value.t -> parsed -> parsed
      val parse : string -> string -> parsed ref -> unit
      type parse_result =
      1. | Ok
      2. | Parse_failed of exn
      val parse_no_error : string -> parsed ref -> parse_result
      val get : key:S.Key.t -> parsed -> S.Value.t
      +Make (ocaml.Arg_helper.Make)

      Module Arg_helper.Make

      Parameters

      module S : sig ... end

      Signature

      type parsed
      val default : S.Value.t -> parsed
      val set_base_default : S.Value.t -> parsed -> parsed
      val add_base_override : S.Key.t -> S.Value.t -> parsed -> parsed
      val reset_base_overrides : parsed -> parsed
      val set_user_default : S.Value.t -> parsed -> parsed
      val add_user_override : S.Key.t -> S.Value.t -> parsed -> parsed
      val parse : string -> string -> parsed ref -> unit
      type parse_result =
      1. | Ok
      2. | Parse_failed of exn
      val parse_no_error : string -> parsed ref -> parse_result
      val get : key:S.Key.t -> parsed -> S.Value.t
      diff --git a/dev/ocaml/Arg_helper/index.html b/dev/ocaml/Arg_helper/index.html index a854d6c3..064c35b5 100644 --- a/dev/ocaml/Arg_helper/index.html +++ b/dev/ocaml/Arg_helper/index.html @@ -1,2 +1,2 @@ -Arg_helper (ocaml.Arg_helper)

      Module Arg_helper

      Decipher command line arguments of the form <value> | <key>=<value>,...

      (as used for example for the specification of inlining parameters varying by simplification round).

      Warning: this module is unstable and part of compiler-libs.

      module Make (S : sig ... end) : sig ... end
      +Arg_helper (ocaml.Arg_helper)

      Module Arg_helper

      Decipher command line arguments of the form <value> | <key>=<value>,...

      (as used for example for the specification of inlining parameters varying by simplification round).

      Warning: this module is unstable and part of compiler-libs.

      module Make (S : sig ... end) : sig ... end
      diff --git a/dev/ocaml/Asmgen/index.html b/dev/ocaml/Asmgen/index.html index df1be970..1a665760 100644 --- a/dev/ocaml/Asmgen/index.html +++ b/dev/ocaml/Asmgen/index.html @@ -1,5 +1,5 @@ -Asmgen (ocaml.Asmgen)

      Module Asmgen

      From Lambda to assembly code

      type middle_end = +Asmgen (ocaml.Asmgen)

      Module Asmgen

      From Lambda to assembly code

      type middle_end = backend:(module Backend_intf.S) -> prefixname:string -> ppf_dump:Stdlib.Format.formatter -> diff --git a/dev/ocaml/Asmlibrarian/index.html b/dev/ocaml/Asmlibrarian/index.html index ebf30582..1d72cc5e 100644 --- a/dev/ocaml/Asmlibrarian/index.html +++ b/dev/ocaml/Asmlibrarian/index.html @@ -1,2 +1,2 @@ -Asmlibrarian (ocaml.Asmlibrarian)

      Module Asmlibrarian

      val create_archive : string list -> string -> unit
      type error =
      1. | File_not_found of string
      2. | Archiver_error of string
      exception Error of error
      val report_error : Stdlib.Format.formatter -> error -> unit
      +Asmlibrarian (ocaml.Asmlibrarian)

      Module Asmlibrarian

      val create_archive : string list -> string -> unit
      type error =
      1. | File_not_found of string
      2. | Archiver_error of string
      exception Error of error
      val report_error : Stdlib.Format.formatter -> error -> unit
      diff --git a/dev/ocaml/Asmlink/index.html b/dev/ocaml/Asmlink/index.html index 61f60613..68e91267 100644 --- a/dev/ocaml/Asmlink/index.html +++ b/dev/ocaml/Asmlink/index.html @@ -1,5 +1,5 @@ -Asmlink (ocaml.Asmlink)

      Module Asmlink