mirror of
https://github.com/c-cube/moonpool.git
synced 2025-12-10 21:24:05 -05:00
perf: account for main domain when starting background domains
This commit is contained in:
parent
ed4cc2550b
commit
ab2d8d4956
1 changed files with 3 additions and 1 deletions
|
|
@ -12,7 +12,9 @@ type worker = { q: (unit -> unit) Bb_queue.t } [@@unboxed]
|
||||||
|
|
||||||
let domains_ : worker array lazy_t =
|
let domains_ : worker array lazy_t =
|
||||||
lazy
|
lazy
|
||||||
(let n = Domain_.recommended_number () in
|
((* number of domains we spawn. Note that we spawn n-1 domains
|
||||||
|
because there already is the main domain running. *)
|
||||||
|
let n = Domain_.recommended_number () - 1 in
|
||||||
Array.init n (fun i ->
|
Array.init n (fun i ->
|
||||||
let q = Bb_queue.create () in
|
let q = Bb_queue.create () in
|
||||||
let _domain : domain = Domain_.spawn (fun () -> work_ i q) in
|
let _domain : domain = Domain_.spawn (fun () -> work_ i q) in
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue