Provide a process pool with enhanced performance on Windows, copied and slightly adapted from cobra.
- class straindesign.pool.SDPool(processes: int | None = None, initializer: Callable | None = None, initargs: Tuple = (), maxtasksperchild: int | None = None, context=None)
Multiprocessing process pool with enhanced Windows compatibility
Initialize a process pool.
Add a thin layer on top of the multiprocessing.Pool that, on Windows, passes initialization code to workers via a pickle file rather than directly. This is done to avoid a performance issue that exists on Windows. Please, also see the discussion .
- __exit__(*args, **kwargs)
Clean up resources when leaving a context
Call cleanup function and close