Commit graph

31 commits

Author SHA1 Message Date
Simon Cruanes
cc8860c6e3
split into moonpool.private and moonpool; format; remove DLA 2024-02-11 16:39:43 -05:00
Simon Cruanes
3f7ed7b6b8 moonpool: expose Fut.{spawn_on_current_runner,await} 2023-11-08 12:02:13 -05:00
Simon Cruanes
2073c600c4 add Moonpool.run_async 2023-11-08 11:36:10 -05:00
Simon Cruanes
00a5cfc8ba fix: rename Thread_local_storage_ to not collide with the library 2023-11-08 09:41:57 -05:00
Simon Cruanes
21ac980fb2 rename no_runner to immediate_runner 2023-11-08 09:41:57 -05:00
Simon Cruanes
056f80b318 add No_runner: a runner that doesn't do anything in the background
The idea is that you might have APIs that want a runner, but the work is
too trivial to require a full actual thread pool. In this case use
`No_runner.runner` and calls to `run_async runner f` will turn into `f()`.
2023-11-08 09:41:57 -05:00
Simon Cruanes
a3d3468b5e feat: add Moonpool.recommended_thread_count 2023-11-08 09:41:57 -05:00
Simon Cruanes
e67bffeca5
ws_pool: use TLS for quick worker storage access; reduce contention 2023-10-27 15:18:50 -04:00
Simon Cruanes
3e614ec992
rename Pool to Ws_pool; deprecated Moonpool.Pool 2023-10-25 23:43:18 -04:00
Simon Cruanes
6452ca89d1
rename Simple_pool into Fifo_pool, update doc 2023-10-25 21:55:29 -04:00
Simon Cruanes
e67ab53f9f
feat pool: rewrite main pool to use work stealing
there's a single blocking queue, and one WS_queue per worker. Scheduling
into the pool from a worker (e.g. via fork_join or explicitly) will push
into this WS queue; otherwise it goes into the main blocking queue.

Workers will always try to empty their local queue first, then try to
work steal, then block on the main queue.
2023-10-25 00:19:34 -04:00
Simon Cruanes
3834bf0796 add Bounded_queue 2023-10-12 22:24:28 -04:00
Simon Cruanes
1cb5342092
expose Runner 2023-07-10 22:48:04 -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
2852741360
feat: add a Lock module 2023-07-09 19:49:25 -04:00
Simon Cruanes
309424a58f move fork join into its own module 2023-07-05 21:55:00 -04:00
Simon Cruanes
1e21157e8a
feat: add Chan again 2023-06-18 22:09:22 -04:00
Simon Cruanes
e8ba4feea1
expose Atomic 2023-06-10 00:21:46 -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
b9ee0d71a1
add Chan, an atomic unbounded channel 2023-06-08 00:19:37 -04:00
Simon Cruanes
2d9e834ccc
small fix 2023-06-01 22:14:44 -04:00
Simon Cruanes
d87dff529d
split into multiple files 2023-06-01 22:04:06 -04:00
Simon Cruanes
835eaf84c4
global thread loop wrappers 2023-06-01 21:54:22 -04:00
Simon Cruanes
feb3b39912
add optional wrapper for worker loop
this makes it possible to instrument the pool workers, or install
effect handlers to provide some form of `await`.
2023-06-01 21:39:36 -04:00
Simon Cruanes
5dcfab7cce
require 4.08; add infix operators; add dep on Either 2023-06-01 21:34:27 -04:00
Simon Cruanes
d7220c75f5
add start_thread_on_some_domain 2023-06-01 20:59:25 -04:00
Simon Cruanes
f9ba356657
Fut.wait_block: a bit of spinning before blocking 2023-05-31 00:58:51 -04:00
Simon Cruanes
a585cc8158
fix: uniformize domain stub 2023-05-31 00:45:43 -04:00
Simon Cruanes
d31a84bab4
add combinators to Fut 2023-05-30 23:51:52 -04:00
Simon Cruanes
1619f8b773
initial commit 2023-05-30 23:03:05 -04:00