mirror of
https://github.com/c-cube/moonpool.git
synced 2025-12-06 03:05:30 -05:00
prepare for 0.3
This commit is contained in:
parent
366d26527c
commit
8e9628ac81
8 changed files with 36 additions and 13 deletions
23
CHANGES.md
23
CHANGES.md
|
|
@ -1,4 +1,27 @@
|
|||
|
||||
# 0.3
|
||||
|
||||
- add `Fork_join` for parallelizing computations. This is only
|
||||
available on OCaml 5.x because it relies on effects.
|
||||
- add `Fork_join.{for_,map_array,map_list}`
|
||||
- add `Fork_join.all_{list,init}`
|
||||
- add `Pool.with_`
|
||||
- add a channel module
|
||||
- add `Runner`, change `Pool` to produce a `Runner.t`
|
||||
- add a `Lock` module
|
||||
- add support for domain-local-await when installed
|
||||
- add `Fut.await` for OCaml >= 5.0
|
||||
|
||||
- fix: Fork_join.both_ignore now has a more general type
|
||||
|
||||
- expose `Suspend_` and its internal effect with an unstability alert.
|
||||
This is intended for implementors of `Runner` only.
|
||||
- port `cpp.ml` from containers, replace previous codegen with it.
|
||||
This will provide better flexibility for supporting multiple versions
|
||||
of OCaml in the future.
|
||||
- add `Pool.run_wait_block`; rename `Pool.run` into `Pool.run_async`
|
||||
- fix: in blocking queue, `pop` works on a non empty closed queue
|
||||
|
||||
# 0.2
|
||||
|
||||
- add `Fut.for_list`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
(using mdx 0.2)
|
||||
|
||||
(name moonpool)
|
||||
(version 0.2)
|
||||
(version 0.3)
|
||||
(generate_opam_files true)
|
||||
(source
|
||||
(github c-cube/moonpool))
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# This file is generated by dune, edit dune-project instead
|
||||
opam-version: "2.0"
|
||||
version: "0.2"
|
||||
version: "0.3"
|
||||
synopsis: "Pools of threads supported by a pool of domains"
|
||||
maintainer: ["Simon Cruanes"]
|
||||
authors: ["Simon Cruanes"]
|
||||
|
|
|
|||
|
|
@ -47,6 +47,6 @@ val close : _ t -> unit
|
|||
val pop_await : 'a t -> 'a
|
||||
(** Like {!pop} but suspends the current thread until an element is
|
||||
available. See {!Fut.await} for more details.
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.3 *)
|
||||
|
||||
[@@@endif]
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ val for_ : ?chunk_size:int -> int -> (int -> int -> unit) -> unit
|
|||
Use [~chunk_size:1] if you explicitly want to
|
||||
run each iteration of the loop in its own task.
|
||||
|
||||
@since NEXT_RELEASE
|
||||
@since 0.3
|
||||
{b NOTE} this is only available on OCaml 5. *)
|
||||
|
||||
val all_array : ?chunk_size:int -> (unit -> 'a) array -> 'a array
|
||||
|
|
@ -71,7 +71,7 @@ val all_array : ?chunk_size:int -> (unit -> 'a) array -> 'a array
|
|||
@param chunk_size if equal to [n], groups items by [n] to be run in
|
||||
a single task. Default is [1].
|
||||
|
||||
@since NEXT_RELEASE
|
||||
@since 0.3
|
||||
{b NOTE} this is only available on OCaml 5. *)
|
||||
|
||||
val all_list : ?chunk_size:int -> (unit -> 'a) list -> 'a list
|
||||
|
|
@ -80,7 +80,7 @@ val all_list : ?chunk_size:int -> (unit -> 'a) list -> 'a list
|
|||
|
||||
@param chunk_size if equal to [n], groups items by [n] to be run in
|
||||
a single task. Default is not specified.
|
||||
This parameter is available since NEXT_RELEASE.
|
||||
This parameter is available since 0.3.
|
||||
|
||||
@since 0.3
|
||||
{b NOTE} this is only available on OCaml 5. *)
|
||||
|
|
@ -91,19 +91,19 @@ val all_init : ?chunk_size:int -> int -> (int -> 'a) -> 'a list
|
|||
|
||||
@param chunk_size if equal to [n], groups items by [n] to be run in
|
||||
a single task. Default is not specified.
|
||||
This parameter is available since NEXT_RELEASE.
|
||||
This parameter is available since 0.3.
|
||||
|
||||
@since 0.3
|
||||
{b NOTE} this is only available on OCaml 5. *)
|
||||
|
||||
val map_array : ?chunk_size:int -> ('a -> 'b) -> 'a array -> 'b array
|
||||
(** [map_array f arr] is like [Array.map f arr], but runs in parallel.
|
||||
@since NEXT_RELEASE
|
||||
@since 0.3
|
||||
{b NOTE} this is only available on OCaml 5. *)
|
||||
|
||||
val map_list : ?chunk_size:int -> ('a -> 'b) -> 'a list -> 'b list
|
||||
(** [map_list f l] is like [List.map f l], but runs in parallel.
|
||||
@since NEXT_RELEASE
|
||||
@since 0.3
|
||||
{b NOTE} this is only available on OCaml 5. *)
|
||||
|
||||
[@@@endif]
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
(** Mutex-protected resource.
|
||||
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.3 *)
|
||||
|
||||
type 'a t
|
||||
(** A value protected by a mutex *)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
A pool of threads. The pool contains a fixed number of threads that
|
||||
wait for work items to come, process these, and loop.
|
||||
|
||||
This implements {!Runner.t} since NEXT_RELEASE.
|
||||
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.
|
||||
|
|
@ -66,7 +66,7 @@ val with_ : (unit -> (t -> 'a) -> 'a) create_args
|
|||
are released.
|
||||
|
||||
Most parameters are the same as in {!create}.
|
||||
@since NEXT_RELEASE *)
|
||||
@since 0.3 *)
|
||||
|
||||
val run : t -> (unit -> unit) -> unit
|
||||
[@@deprecated "use run_async"]
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
(** Abstract runner.
|
||||
|
||||
This provides an abstraction for running tasks in the background.
|
||||
@since NEXT_RELEASE
|
||||
@since 0.3
|
||||
*)
|
||||
|
||||
type task = unit -> unit
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue