Commit graph

476 commits

Author SHA1 Message Date
Simon Cruanes
9623e2d4b6
add Moonpool_io.main; make configure idempotent 2024-09-05 13:24:17 -04:00
Simon Cruanes
65bc3c97ff
alias for get_current_runner 2024-09-05 09:55:10 -04:00
Simon Cruanes
9b3c75124e
simon/move to picos (#30)
* feat: depend on picos, use picos.exn_bt

* refactor: remove dla

* non optional dependency on thread-local-storage

it's a dep of picos anyway

* wip: use picos computations

* disable t_fib1 test, way too flaky

* feat `fut`: wrap picos computations

* detail in fut

* gitignore

* refactor core: use picos for schedulers; add Worker_loop_

we factor most of the thread workers' logic in `Worker_loop_`,
which is now shared between Ws_pool and Fifo_pool

* github actions

* feat fut: add `on_result_ignore`

* details

* wip: port to picos

* test: wip porting tests

* fix fut: trigger failing to attach doesn't signal it

* fix pool: only return No_more_tasks when local and global q empty

* format

* chore: fix CI by installing picos first

* more CI

* test: re-enable t_fib1 but with a single core fifo pool

it should be deterministic now!

* fixes after reviews

* bump minimal OCaml version to 4.13

* use `exn_bt`, not `picos.exn_bt`

* feat: optional dep on hmap, for inheritable FLS data

* format

* chore: depend on picos explicitly

* feat: move hmap-fls to Fiber.Fls

* change API for local FLS hmap

* refactor: move optional hmap FLS stuff into core/task_local_storage

* add Task_local_storage.remove_in_local_hmap

* chore: try to fix CI

* format

* chore: CI

* fix

* feat: add `Fls.with_in_local_hmap`

* chore: depend on hmap for tests

* fix test for FLS

use the inheritable keys

* chore: CI

* require OCaml 4.14 :/

* feat: add `moonpool.sync` with await-friendly abstractions

based on picos_sync

* fix: catch TLS.Not_set

* fix: `LS.get` shouldn't raise

* fix

* update to merged picos PR

* chore: CI

* fix dep

* feat: add `Event.of_fut`

* chore: CI

* remove dep on now defunct `exn_bt`

* feat: add moonpool-io

* chore: CI

* version constraint on moonpool-io

* add Event.Infix

* move to picos_io
2024-09-04 12:04:27 -04:00
Simon Cruanes
e3f11be0b3
fix related to TLS 2024-08-27 10:15:40 -04:00
Simon Cruanes
14fdee0593
compat 2024-08-26 11:23:54 -04:00
Simon Cruanes
444f8a3acc
fix with actual TLS release 2024-08-26 11:20:27 -04:00
Simon Cruanes
265d4f73dd
move to thread-local-storage 0.2 with get/set API 2024-08-16 10:07:51 -04:00
Simon Cruanes
3388098fcc
smol comment on OCaml 4 2024-06-26 11:30:29 -04:00
Simon Cruanes
a4db1e67be
chore: use 5.2 in CI (#28)
chore: use 5.2 in CI
2024-05-20 16:26:33 -04:00
Simon Cruanes
0750e6af41
prepare for 0.6 2024-04-02 12:51:57 -04:00
Simon Cruanes
a127a4131a
test 2024-04-02 12:51:57 -04:00
Simon Cruanes
83ada948aa
test: do not run lwt tests on mac OS for now 2024-04-02 12:51:57 -04:00
Simon Cruanes
a1814cadb4
lwt test 2024-04-02 12:51:57 -04:00
Simon Cruanes
cf6b20a979
update fiber tests to try to be more deterministic 2024-04-02 12:51:57 -04:00
Simon Cruanes
ef6811e062
do not run some tests on mac OS 2024-04-02 12:51:57 -04:00
Simon Cruanes
8e240357b5
update test outputs 2024-04-02 12:51:57 -04:00
Simon Cruanes
80e8f84703
test 2024-04-02 12:51:57 -04:00
Simon Cruanes
6981d37232
fix CI 2024-04-02 12:51:57 -04:00
Simon Cruanes
a99c0775e2
format dune files 2024-04-02 12:51:57 -04:00
Simon Cruanes
7a558bb5f3
chore: CI 2024-04-02 12:51:57 -04:00
Simon Cruanes
81b272e685
fix test 2024-04-02 12:51:57 -04:00
Simon Cruanes
ac851a6d81
fix: in Fut.await, upon failure, use resume
otherwise a fairly vicious bug happens: the await-er is resumed on the
current runner, not its native one, which can cause deadlocks as it
breaks the executors' dependency DAG. When using `resume` there is no
bug since `resume` is designed to always schedule on the correct runner.
2024-04-02 12:51:57 -04:00
Simon Cruanes
0d325741f4
add Exn_bt.pp 2024-04-02 12:51:57 -04:00
Simon Cruanes
ba1876f957
remove use of 5.1 only function 2024-03-21 17:02:03 -04:00
Simon Cruanes
8e6340846a
ensure that tests belong to the correct package 2024-03-21 10:32:41 -04:00
Simon Cruanes
54f6db0b42
test: add package 2024-03-15 00:02:42 -04:00
Simon Cruanes
53ed71db99
fix: make Fiber.check_if_cancelled fail if the fiber is not done 2024-03-14 23:47:26 -04:00
Simon Cruanes
f9aea68d61
add ?on param to Fiber.spawn 2024-03-05 09:47:31 -05:00
Simon Cruanes
f798420423
doc 2024-03-04 22:56:41 -05:00
Simon Cruanes
867444d975
perf: add Fut.raise_if_failed, use it in Fiber.check_if_cancelled 2024-03-04 22:05:47 -05:00
Simon Cruanes
86c6edffca
doc 2024-03-04 21:51:36 -05:00
Simon Cruanes
9cb10a79e6
renaming 2024-03-04 21:38:50 -05:00
Simon Cruanes
533b6e5ce2
docs 2024-03-04 21:22:41 -05:00
Simon Cruanes
3bdd269ca3
more docs, rename a function 2024-03-04 21:02:23 -05:00
Simon Cruanes
ad4ddc6816
refactor: split off domain pool to moonpool.dpool 2024-03-04 20:57:49 -05:00
Simon Cruanes
184690b21c readme 2024-03-04 20:49:34 -05:00
Simon Cruanes
c878b1a198 test for Moonpool_fib.main 2024-03-04 20:49:34 -05:00
Simon Cruanes
48fbf876dc feat: add Moonpool_fib.main
this is a convenient entrypoint for programs that use fibers. The main
thread can thus await fibers that run in the background.
2024-03-04 20:49:34 -05:00
Simon Cruanes
9df848cd17 breaking: remove Immediate_runner
it never really supported all that a runner should (effects, scheduling
other tasks, etc.)
2024-03-04 20:49:34 -05:00
Simon Cruanes
25104ce3b7 feat fifo: expose private interface for the main runner threads 2024-03-04 20:49:34 -05:00
Simon Cruanes
51459f9b0b feat: add Runner.dummy 2024-03-04 20:49:34 -05:00
Simon Cruanes
66f95df3b4 add Fiber.{return,fail} 2024-03-04 20:49:34 -05:00
Simon Cruanes
5817a8aee7 revert nurseries 2024-03-04 20:49:34 -05:00
Simon Cruanes
8c10c2b329 expose Task_local_storage.get_current 2024-03-04 20:49:34 -05:00
Simon Cruanes
45b8aa9999 cleanup the local storage APIs 2024-03-04 20:49:34 -05:00
Simon Cruanes
953947f694 feat local-storage: expose get/set with explicit storage 2024-03-04 20:49:34 -05:00
Simon Cruanes
4325fda345 update tests 2024-03-04 20:49:34 -05:00
Simon Cruanes
37751c79e4 introduce Fiber.Nursery.t; change local storage accordingly 2024-03-04 20:49:34 -05:00
Simon Cruanes
cec77d2ee9 doc 2024-03-04 20:49:34 -05:00
Simon Cruanes
9d392b1ba6
fix 2024-03-01 14:58:28 -05:00