This commit is contained in:
Simon Cruanes 2025-11-12 00:24:48 -05:00
parent ee7972910f
commit 997d996c13
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4

View file

@ -14,14 +14,11 @@ let run ~kind () =
let pool = let pool =
let on_init_thread ~dom_id:_ ~t_id () = let on_init_thread ~dom_id:_ ~t_id () =
Trace.set_thread_name (Printf.sprintf "pool worker %d" t_id) Trace.set_thread_name (Printf.sprintf "pool worker %d" t_id)
and around_task =
( (fun self -> Trace.counter_int "n_tasks" (Ws_pool.num_tasks self)),
fun self () -> Trace.counter_int "n_tasks" (Ws_pool.num_tasks self) )
in in
match kind with match kind with
| `Simple -> Fifo_pool.create ~num_threads:3 ~on_init_thread ~around_task () | `Simple -> Fifo_pool.create ~num_threads:3 ~on_init_thread ()
| `Ws_pool -> Ws_pool.create ~num_threads:3 ~on_init_thread ~around_task () | `Ws_pool -> Ws_pool.create ~num_threads:3 ~on_init_thread ()
in in
(* make all threads busy *) (* make all threads busy *)