Commit graph

82 commits

Author SHA1 Message Date
Simon Cruanes
a24bd7472d
feat worker_loop: always use reschedule in await
it's better than continuing right now because it will potentially
reschedule on the correct runner.
2025-09-26 14:55:25 -04:00
Simon Cruanes
f53dbe4dda
cleanup worker loop 2025-09-26 14:55:25 -04:00
Simon Cruanes
55e3e77a66
core: cleanup, and add a fined grained API for worker loop 2025-09-26 14:55:24 -04:00
Simon Cruanes
f8d5c564de
remove version-dependent preprocessor 2025-07-09 15:42:23 -04:00
Simon Cruanes
5ea9a3f587
remove bounded_queue 2025-07-09 15:28:25 -04:00
Simon Cruanes
867cbd2318
fix core: better repropagating of errors
Some checks failed
github pages / Deploy doc (push) Has been cancelled
Build and Test / build (push) Has been cancelled
Build and Test / build-compat (push) Has been cancelled
Build and Test / format (push) Has been cancelled
2025-06-20 16:49:27 -04:00
Simon Cruanes
eba239487c
add Fut.{cancel,try_cancel}
Some checks failed
github pages / Deploy doc (push) Has been cancelled
Build and Test / build (push) Has been cancelled
Build and Test / build-compat (push) Has been cancelled
Build and Test / format (push) Has been cancelled
2025-05-21 11:48:12 -04:00
Simon Cruanes
213d9bdd19
revert previous delayed await
Some checks failed
github pages / Deploy doc (push) Has been cancelled
Build and Test / build (push) Has been cancelled
Build and Test / build-compat (push) Has been cancelled
Build and Test / format (push) Has been cancelled
2025-05-02 13:04:04 -04:00
Simon Cruanes
bb9418d86a
format with 0.27 2025-05-02 10:58:50 -04:00
Simon Cruanes
d50c227578
perf: await on immediately ready timer queues its task 2025-05-02 10:51:46 -04:00
Simon Cruanes
b46a048401
feat: add Moonpool.yield on ocaml 5
a mere alias to Picos.Fiber.yield
2025-05-02 10:33:30 -04:00
Simon Cruanes
ed0eda226c
prepare for 0.8 2025-04-17 16:35:19 -04:00
Simon Cruanes
2b00a0cea1
feat(exn_bt): in show/pp, do print the backtrace when present 2025-04-15 10:10:02 -04:00
Simon Cruanes
3a5eaaa44d
api(fut): public alias 'a Fut.t = 'a Picos.Computation.t 2025-03-19 17:40:17 -04:00
Simon Cruanes
f0ea8c294d
single system call for signal blocking 2025-03-13 15:42:04 -04:00
Simon Cruanes
dd88008a0a
fix: do not die if we fail to block a signal 2025-03-13 10:45:21 -04:00
Simon Cruanes
c51a0a6bd4
don't try to block sigstop 2025-03-13 10:45:01 -04:00
Simon Cruanes
deb96302e1
mli for worker loop 2025-03-13 10:07:39 -04:00
Simon Cruanes
a20208ec37
feat: block signals in workers if asked to 2025-03-13 10:07:20 -04:00
Simon Cruanes
6ab9a691bf
feat hmap FLS: do not fail if run outside of a fiber 2024-12-04 10:27:04 -05:00
Simon Cruanes
ea1af6ed22
fix task local storage: type was too specific 2024-12-04 08:45:26 -05:00
Simon Cruanes
fa40cf8825
doc 2024-10-18 12:56:43 -04:00
Simon Cruanes
9a598b1efc
feat: add Fut.make_promise, have 'a promise = private 'a fut 2024-10-18 12:52:21 -04:00
Simon Cruanes
d4be74c1b7
cleanup 2024-09-25 22:54:18 -04:00
Simon Cruanes
e7ee012108
chan: go back to the lock-full version 2024-09-25 22:19:34 -04:00
Simon Cruanes
94998ea407
lock free chan 2024-09-25 22:17:41 -04:00
Simon Cruanes
35a69924d3
wip: change Moonpool.Chan so it's bounded
also push/pop require effects, the OCaml 4 version only allows
for try_push/try_pop.
2024-09-25 21:32:11 -04:00
Simon Cruanes
0d8767f45f
prepare for 0.7 2024-09-10 08:54:07 -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
265d4f73dd
move to thread-local-storage 0.2 with get/set API 2024-08-16 10:07:51 -04:00
Simon Cruanes
0750e6af41
prepare for 0.6 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
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
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
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
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
37751c79e4 introduce Fiber.Nursery.t; change local storage accordingly 2024-03-04 20:49:34 -05:00
Simon Cruanes
4195d4d61c
feat: add Task_local_storage.get_opt 2024-02-29 15:29:08 -05:00
Simon Cruanes
a2ea24551b
compat 2024-02-27 22:48:23 -05:00
Simon Cruanes
42d16465c3
compat 2024-02-27 22:35:07 -05:00
Simon Cruanes
c39435d8eb
fix fifo_pool: resume can be called from another worker
we might schedule on  worker 1, suspend, resume on worker 2,
and resume from there.
2024-02-27 22:31:25 -05:00