Simon Cruanes
e67bffeca5
ws_pool: use TLS for quick worker storage access; reduce contention
2023-10-27 15:18:50 -04:00
Simon Cruanes
b4ddd82ee8
ws pool: use non atomic boolean to reduce number of wakeups; refactor
2023-10-27 14:48:13 -04:00
Simon Cruanes
359ec0352b
small change to test
2023-10-27 14:47:59 -04:00
Simon Cruanes
68fe7221b8
suspend: remove additional parameter, always run tasks in handler
2023-10-27 14:47:54 -04:00
Simon Cruanes
9e0a583a94
chore: disable -dl/-seq benchs for now, too verbose
2023-10-27 14:46:59 -04:00
Simon Cruanes
c044fb8fc9
tweal to WS pool
2023-10-27 12:26:50 -04:00
Simon Cruanes
08722691e8
ws deque: try to reduce false sharing
2023-10-27 12:26:43 -04:00
Simon Cruanes
9e93ebd3bb
update benchmark fib-rec with more implementations
2023-10-27 12:26:03 -04:00
Simon Cruanes
5409cf8e1b
compat 4.08
2023-10-25 23:50:34 -04:00
Simon Cruanes
3e614ec992
rename Pool to Ws_pool; deprecated Moonpool.Pool
2023-10-25 23:43:18 -04:00
Simon Cruanes
30035fa67d
fix pool: suspension handler might run from a different thread!
...
this means we can't reuse the same worker state, it's neither thread
safe nor deadlock-safe (the worker whose state it is might be waiting on
the main queue)
2023-10-25 23:30:04 -04:00
Simon Cruanes
1e3629bc67
fix ws_deque: strict bound for shrinking
2023-10-25 23:29:47 -04:00
Simon Cruanes
629b66662f
fix ws_deque: circular array is also in an atomic
2023-10-25 23:18:47 -04:00
Simon Cruanes
1ed25e5aca
test: make t_ws_deque consume less ram
2023-10-25 22:41:26 -04:00
Simon Cruanes
dfb588cdc5
test: update readme
2023-10-25 22:41:18 -04:00
Simon Cruanes
056986c84f
perf pool: no retries for self-queue; fewer retries for stealing
2023-10-25 22:38:43 -04:00
Simon Cruanes
e937bf0e9d
perf pool: restore non-hashtable lookup for self-queuing
2023-10-25 22:38:35 -04:00
Simon Cruanes
3956fb6566
fix ws_pool: no work stealing for pools of 1 worker
...
there would be a loop because it'd try to find the index of another
worker to steal from, but loop forever because there is no other worker.
2023-10-25 22:33:08 -04:00
Simon Cruanes
d9da7844e2
test: run more diverse pools in t_fib_rec
2023-10-25 22:32:57 -04:00
Simon Cruanes
894851f6e8
comments in ws_deque
2023-10-25 22:32:42 -04:00
Simon Cruanes
530507d84e
fix fifo_pool: raise Shutdown, not Closed, in run
2023-10-25 22:11:08 -04:00
Simon Cruanes
3f720241b2
feat pool: use Shutdown when running a task after it's closed
2023-10-25 22:10:10 -04:00
Simon Cruanes
9a1309c44f
chore: add keywords in opam
2023-10-25 22:03:35 -04:00
Simon Cruanes
a89c0ce4f2
breaking: make Runner.t abstract
2023-10-25 21:59:22 -04:00
Simon Cruanes
6452ca89d1
rename Simple_pool into Fifo_pool, update doc
2023-10-25 21:55:29 -04:00
Simon Cruanes
db33bec13f
wip: better work stealing pool
2023-10-25 12:11:41 -04:00
Simon Cruanes
e0d3a18562
improve test a bit
2023-10-25 09:57:25 -04:00
Simon Cruanes
fdc188c291
wip: debug pool
2023-10-25 09:57:19 -04:00
Simon Cruanes
3d7e272d01
perf ws_deque: use bitmasks instead of modulo op
2023-10-25 09:57:05 -04:00
Simon Cruanes
78407c495d
more tests for WS_deque
2023-10-25 09:56:56 -04:00
Simon Cruanes
078adae786
limit CI time
2023-10-25 09:28:18 -04:00
Simon Cruanes
91c0c3f6c1
fix props
2023-10-25 01:01:51 -04:00
Simon Cruanes
ef05146e03
tweak retry thresholds in pool
2023-10-25 00:28:19 -04:00
Simon Cruanes
3bfc4cdcc7
more test
2023-10-25 00:28:16 -04:00
Simon Cruanes
73c2f9768c
benchs: run with both pool and simple_pool
2023-10-25 00:21:29 -04:00
Simon Cruanes
c03e342178
tests: run some tests on both Pool and Simple_pool
2023-10-25 00:21:07 -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
f2e9f99b36
perf ws_deque: implement shrinking and a push optim
2023-10-25 00:17:50 -04:00
Simon Cruanes
ae5f3a7e97
tests for ws_deque
2023-10-25 00:09:38 -04:00
Simon Cruanes
95b27b3a70
feat: add Ws_deque_
2023-10-25 00:09:28 -04:00
Simon Cruanes
0cec78eb30
refactor: move some common code to Suspend_
2023-10-25 00:09:09 -04:00
Simon Cruanes
4c4b720306
feat: add Simple_pool, with the naive single-queue implementation
2023-10-25 00:08:48 -04:00
Simon Cruanes
43eca1d4e2
restore test
2023-10-24 19:56:18 -04:00
Simon Cruanes
fb7cc5d69f
add heavier test for a particular hangup in fork join
2023-10-24 16:56:52 -04:00
Simon Cruanes
9ab9df78c9
update tests a bit
2023-10-24 13:48:23 -04:00
Simon Cruanes
d15bfb07f2
fix pool: rework scheduler to use one condition
2023-10-24 13:47:53 -04:00
Simon Cruanes
69faea0bcb
wip: have only one condition in pool
2023-10-24 12:53:19 -04:00
Simon Cruanes
60255c0e95
test: add dep on trace-tef; add new test for scheduling issues
...
trying to expose that sometimes, some workers might be asleep while
others do several tasks, because they're sleeping on the "wrong" queue
2023-10-24 10:03:46 -04:00
Simon Cruanes
faeb95b49d
fix pool: on shutdown, finish reading from all queues
2023-10-24 09:53:18 -04:00
Simon Cruanes
b8a31b088f
fix @since tags
2023-10-19 11:08:28 -04:00