diff --git a/src/core/d_pool_.ml b/src/core/domain_pool_.ml similarity index 100% rename from src/core/d_pool_.ml rename to src/core/domain_pool_.ml diff --git a/src/core/d_pool_.mli b/src/core/domain_pool_.mli similarity index 100% rename from src/core/d_pool_.mli rename to src/core/domain_pool_.mli diff --git a/src/core/dune b/src/core/dune index 8888aada..b52f72f9 100644 --- a/src/core/dune +++ b/src/core/dune @@ -3,7 +3,7 @@ (name moonpool) (libraries moonpool.private) (flags :standard -open Moonpool_private) - (private_modules d_pool_) + (private_modules domain_pool_) (preprocess (action (run %{project_root}/src/cpp/cpp.exe %{input-file})))) diff --git a/src/core/fifo_pool.ml b/src/core/fifo_pool.ml index 80841183..b09f6e2b 100644 --- a/src/core/fifo_pool.ml +++ b/src/core/fifo_pool.ml @@ -87,7 +87,7 @@ let create ?(on_init_thread = default_thread_init_exit_) | None -> AT_pair (ignore, fun _ _ -> ()) in - let num_domains = D_pool_.n_domains () in + let num_domains = Domain_pool_.n_domains () in (* number of threads to run *) let num_threads = Util_pool_.num_threads ?num_threads () in @@ -136,7 +136,7 @@ let create ?(on_init_thread = default_thread_init_exit_) (* now run the main loop *) Fun.protect run ~finally:(fun () -> (* on termination, decrease refcount of underlying domain *) - D_pool_.decr_on dom_idx); + Domain_pool_.decr_on dom_idx); on_exit_thread ~dom_id:dom_idx ~t_id () in @@ -148,7 +148,7 @@ let create ?(on_init_thread = default_thread_init_exit_) Bb_queue.push receive_threads (i, thread) in - D_pool_.run_on dom_idx create_thread_in_domain + Domain_pool_.run_on dom_idx create_thread_in_domain in (* start all threads, placing them on the domains diff --git a/src/core/fork_join.ml b/src/core/fork_join.ml index 8a4b1fc3..a9abe2af 100644 --- a/src/core/fork_join.ml +++ b/src/core/fork_join.ml @@ -110,7 +110,7 @@ let for_ ?chunk_size n (f : int -> int -> unit) : unit = | Some cs -> max 1 (min n cs) | None -> (* guess: try to have roughly one task per core *) - max 1 (1 + (n / D_pool_.n_domains ())) + max 1 (1 + (n / Domain_pool_.n_domains ())) in let start_tasks ~name ~run (suspension : Suspend_.suspension) = diff --git a/src/core/moonpool.ml b/src/core/moonpool.ml index f2cf0174..d9150a78 100644 --- a/src/core/moonpool.ml +++ b/src/core/moonpool.ml @@ -1,6 +1,6 @@ let start_thread_on_some_domain f x = - let did = Random.int (D_pool_.n_domains ()) in - D_pool_.run_on_and_wait did (fun () -> Thread.create f x) + let did = Random.int (Domain_pool_.n_domains ()) in + Domain_pool_.run_on_and_wait did (fun () -> Thread.create f x) let run_async = Runner.run_async let recommended_thread_count () = Domain_.recommended_number () diff --git a/src/core/util_pool_.ml b/src/core/util_pool_.ml index 8207062a..666472b4 100644 --- a/src/core/util_pool_.ml +++ b/src/core/util_pool_.ml @@ -1,5 +1,5 @@ let num_threads ?num_threads () : int = - let n_domains = D_pool_.n_domains () in + let n_domains = Domain_pool_.n_domains () in (* number of threads to run *) let num_threads = diff --git a/src/core/ws_pool.ml b/src/core/ws_pool.ml index 9dd7196e..77c97cd4 100644 --- a/src/core/ws_pool.ml +++ b/src/core/ws_pool.ml @@ -262,7 +262,7 @@ let create ?(on_init_thread = default_thread_init_exit_) | None -> AT_pair (ignore, fun _ _ -> ()) in - let num_domains = D_pool_.n_domains () in + let num_domains = Domain_pool_.n_domains () in let num_threads = Util_pool_.num_threads ?num_threads () in (* make sure we don't bias towards the first domain(s) in {!D_pool_} *) @@ -330,7 +330,7 @@ let create ?(on_init_thread = default_thread_init_exit_) (* now run the main loop *) Fun.protect run ~finally:(fun () -> (* on termination, decrease refcount of underlying domain *) - D_pool_.decr_on dom_idx); + Domain_pool_.decr_on dom_idx); on_exit_thread ~dom_id:dom_idx ~t_id () in @@ -342,7 +342,7 @@ let create ?(on_init_thread = default_thread_init_exit_) Bb_queue.push receive_threads (i, thread) in - D_pool_.run_on dom_idx create_thread_in_domain + Domain_pool_.run_on dom_idx create_thread_in_domain in (* start all threads, placing them on the domains diff --git a/src/core/domain_.ml b/src/private/domain_.ml similarity index 100% rename from src/core/domain_.ml rename to src/private/domain_.ml