mirror of
https://github.com/c-cube/moonpool.git
synced 2025-12-11 13:38:38 -05:00
fix readme
This commit is contained in:
parent
d751e560e8
commit
1cddaf48a6
2 changed files with 6 additions and 4 deletions
|
|
@ -19,7 +19,8 @@ In addition, some concurrency and parallelism primitives are provided:
|
||||||
On OCaml 5 (meaning there's actual domains and effects, not just threads),
|
On OCaml 5 (meaning there's actual domains and effects, not just threads),
|
||||||
a `Fut.await` primitive is provided. It's simpler and more powerful
|
a `Fut.await` primitive is provided. It's simpler and more powerful
|
||||||
than the monadic combinators.
|
than the monadic combinators.
|
||||||
- `Moonpool.Fork_join` provides the fork-join parallelism primitives
|
- `Moonpool_forkjoin`, in the library `moonpool.forkjoin`
|
||||||
|
provides the fork-join parallelism primitives
|
||||||
to use within tasks running in the pool.
|
to use within tasks running in the pool.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
@ -166,7 +167,8 @@ val expected_sum : int = 5050
|
||||||
|
|
||||||
### Fork-join
|
### Fork-join
|
||||||
|
|
||||||
On OCaml 5, again using effect handlers, the module `Fork_join`
|
On OCaml 5, again using effect handlers, the sublibrary `moonpool.forkjoin`
|
||||||
|
provides a module `Moonpool_forkjoin`
|
||||||
implements the [fork-join model](https://en.wikipedia.org/wiki/Fork%E2%80%93join_model).
|
implements the [fork-join model](https://en.wikipedia.org/wiki/Fork%E2%80%93join_model).
|
||||||
It must run on a pool (using [Runner.run_async] or inside a future via [Fut.spawn]).
|
It must run on a pool (using [Runner.run_async] or inside a future via [Fut.spawn]).
|
||||||
|
|
||||||
|
|
@ -211,7 +213,7 @@ val select_sort : 'a array -> int -> int -> unit = <fun>
|
||||||
)
|
)
|
||||||
done;
|
done;
|
||||||
|
|
||||||
Moonpool.Fork_join.both_ignore
|
Moonpool_forkjoin.both_ignore
|
||||||
(fun () -> quicksort arr i (!low - i))
|
(fun () -> quicksort arr i (!low - i))
|
||||||
(fun () -> quicksort arr !low (len - (!low - i)))
|
(fun () -> quicksort arr !low (len - (!low - i)))
|
||||||
);;
|
);;
|
||||||
|
|
|
||||||
2
dune
2
dune
|
|
@ -3,6 +3,6 @@
|
||||||
(flags :standard -strict-sequence -warn-error -a+8 -w +a-4-40-42-70)))
|
(flags :standard -strict-sequence -warn-error -a+8 -w +a-4-40-42-70)))
|
||||||
|
|
||||||
(mdx
|
(mdx
|
||||||
(libraries moonpool threads)
|
(libraries moonpool moonpool.forkjoin threads)
|
||||||
(enabled_if
|
(enabled_if
|
||||||
(>= %{ocaml_version} 5.0)))
|
(>= %{ocaml_version} 5.0)))
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue