Commit graph

324 commits

Author SHA1 Message Date
Simon Cruanes
68e744290b
add Chan.pop_await 2023-07-09 19:49:27 -04:00
Simon Cruanes
12df71c3ab
expose Suspend_ and its internal effect with an unstability alert 2023-07-09 19:49:27 -04:00
Simon Cruanes
e855c99bec
update doc for Fut 2023-07-09 19:49:27 -04:00
Simon Cruanes
39525af7ac
add documentation; expose Runner.For_runner_implementors.Suspend_ 2023-07-09 19:49:26 -04:00
Simon Cruanes
1d57ae8fbb
remove dead code 2023-07-09 19:49:26 -04:00
Simon Cruanes
76ca0f2d88
feat: add Runner, change Pool to produce a Runner.t
futures, chans, etc. should use the `Runner.t` abstraction
and not depend on the exact pool implementation to run tasks.

For now `Pool.create` is the only implementation of a runner, but now
it's possible to implement alternatives.
2023-07-09 19:49:25 -04:00
Simon Cruanes
2852741360
feat: add a Lock module 2023-07-09 19:49:25 -04:00
Simon Cruanes
b07d460b3f
port cpp.ml from containers, replace previous codegen with it
now OCaml 5-only features are truly available only on OCaml 5, instead
of just relying on the user reading the docstring.
2023-07-09 19:49:24 -04:00
Simon Cruanes
0780dcf703
fix warning 2023-07-06 09:46:33 -04:00
Simon Cruanes
2acf4b28eb feat: actually support domain-local-await if installed 2023-07-05 22:19:18 -04:00
Simon Cruanes
a266a42628 support for domain-local-await when installed 2023-07-05 22:19:18 -04:00
Simon Cruanes
f46cc4f12c fix: Fork_join.both_ignore now has a more general type 2023-07-05 21:55:00 -04:00
Simon Cruanes
03212e7478 fork-join: add both_ignore 2023-07-05 21:55:00 -04:00
Simon Cruanes
43487ebe49 add Fork_join.all_{list,init}
primitives to fork-join over n tasks
2023-07-05 21:55:00 -04:00
Simon Cruanes
45838d9607 fix: in fork-join, start sub-tasks within a handler 2023-07-05 21:55:00 -04:00
Simon Cruanes
309424a58f move fork join into its own module 2023-07-05 21:55:00 -04:00
Simon Cruanes
009855ce0d feat: add Pool.fork_join 2023-07-05 21:55:00 -04:00
Simon Cruanes
9f04d254af
feat: Pool.run_wait_block can return a value now 2023-06-24 15:06:40 -04:00
Simon Cruanes
e4b159c695
fut: fix warnings 2023-06-24 15:05:56 -04:00
Simon Cruanes
ab718b22f9
add Pool.run_wait_block; rename Pool.run into Pool.run_async 2023-06-24 14:50:43 -04:00
Simon Cruanes
1d23d2d7a1
rename Fut.await_exn to Fut.await 2023-06-20 22:43:33 -04:00
Simon Cruanes
4fd6154b56
refactor suspend
do not wrap each step in a new handler; using Effects.Deep we only wrap
the entrypoint of the task, and subsequent `continue` get scheduled
as-is.
2023-06-20 22:43:15 -04:00
Simon Cruanes
e26029ab90
feat: add Fut.await and Fut.await_exn for OCaml >= 5.0
this uses suspension (based on `Suspend_`) to wait for completion of the
future.
2023-06-20 22:43:13 -04:00
Simon Cruanes
52a04701ed
feat: add Suspend_ module, using effects, on OCaml >= 5.0 2023-06-20 22:43:13 -04:00
Simon Cruanes
1e21157e8a
feat: add Chan again 2023-06-18 22:09:22 -04:00
Simon Cruanes
67bc47181c
fix: in blocking queue, pop works on a non empty closed queue 2023-06-15 22:24:58 -04:00
Simon Cruanes
b8588f2d65
feat: add Fut.for_list 2023-06-15 11:59:10 -04:00
Simon Cruanes
d74c6da3fa
fix(fut): fix bug when calling wait_list [] 2023-06-15 11:58:55 -04:00
Simon Cruanes
d60bf3828b
fix: join_array on arrays of length=1 had a bound error 2023-06-15 11:42:13 -04:00
Simon Cruanes
fc3d2d2645
add around_task to Pool.create 2023-06-15 11:23:55 -04:00
Simon Cruanes
b451fde853
add Pool.shutdown_without_waiting 2023-06-15 10:52:17 -04:00
Simon Cruanes
059ee8a1d5
add Pool.num_tasks 2023-06-15 10:35:41 -04:00
Simon Cruanes
f76b713556
add Fut.is_done 2023-06-15 10:24:20 -04:00
Simon Cruanes
f18ed688e9
add Blocking_queue.size 2023-06-15 10:20:33 -04:00
Simon Cruanes
debdc8fc31
add Fut.for_array to easily iterate on an array in parallel 2023-06-14 11:38:01 -04:00
Simon Cruanes
dd5a177a5f
add Fut.get_or_fail{,_exn} 2023-06-14 11:33:24 -04:00
Simon Cruanes
483392986c
perf: limit number of work queues in pool 2023-06-14 11:21:11 -04:00
Simon Cruanes
82af5497f8
pool: do some spinning in run, not in workers 2023-06-13 13:52:22 -04:00
Simon Cruanes
939c6e117c
perf: a few retries in the pool 2023-06-13 13:52:22 -04:00
Simon Cruanes
bde69ba33f
perf: use multiple queues and non-blocking work stealing from them 2023-06-13 13:52:22 -04:00
Simon Cruanes
b084caea69
docs 2023-06-13 13:52:22 -04:00
Simon Cruanes
d766b362f1
feat fut: add infix, builds a INFIX as a 1st class module 2023-06-12 22:06:48 -04:00
Simon Cruanes
7c853861d8
feat fut: add join 2023-06-12 22:06:43 -04:00
Simon Cruanes
0177d6aee7
fix fut: actually run all map/bind callbacks if pool is provided 2023-06-12 22:06:18 -04:00
Simon Cruanes
5e9470b750
comment 2023-06-11 00:06:50 -04:00
Simon Cruanes
e8ba4feea1
expose Atomic 2023-06-10 00:21:46 -04:00
Simon Cruanes
7ee064fc11
more docs on Blocking_queue 2023-06-10 00:06:38 -04:00
Simon Cruanes
b4f0c1572e
expose a simple blocking queue, with a controlled API. 2023-06-10 00:02:50 -04:00
Simon Cruanes
0a4d87816d
remove chan for now, not ready 2023-06-09 23:59:11 -04:00
Simon Cruanes
e820cb83ea
fix 2023-06-09 15:11:25 -04:00