moonpool/src/util_pool_.ml
Simon Cruanes 133a0d6128 breaking: change interface for number of threads
now the user can specify `num_threads`; if not provided a sensible
default is picked.
2023-11-08 09:41:57 -05:00

11 lines
231 B
OCaml

let num_threads ?num_threads () : int =
let n_domains = D_pool_.n_domains () in
(* number of threads to run *)
let num_threads =
match num_threads with
| Some j -> max 1 j
| None -> n_domains
in
num_threads