File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ def __init__(
7171 self .output : List [tuple ] = []
7272
7373 # Minimum number of tasks to run concurrently.
74- self .min_concurrent_count : int = cpu_count () + 1
74+ self .min_concurrent_count : int = self . optimal_process_count ()
7575
7676 # The actual number of tasks may be adjusted dynamically to improve efficiency.
7777 self .concurrent_count : int = self .min_concurrent_count
@@ -176,6 +176,13 @@ def is_running(self) -> bool:
176176 """:returns whether the scheduler is running."""
177177 return self .started and not self .finished and not self .terminated
178178
179+ @staticmethod
180+ def optimal_process_count () -> int :
181+ """
182+ :returns the optimal number of processes based on the number of logical processors.
183+ """
184+ return cpu_count () + 1
185+
179186 def _initialize_output (self ) -> None :
180187 # Initialize `self.output` so that it can be indexed into.
181188 self .output = [None for _ in self .tasks ]
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments