moonpool/src/core/util_pool_.ml
2024-02-11 16:39:44 -05:00

11 lines
236 B
OCaml

let num_threads ?num_threads () : int =
let n_domains = Domain_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