I have a machine learning application in Python. And I'm using the multiprocessing
module in Python to parallelize some of the work (specifically feature computation).
Now, multiprocessing
works differently on Unix variants, and Windows OS.
Unix (mac/linux):
fork/forkserver/spawn
Windows:
spawn
Why multiprocessing.Process behave differently on windows and linux for global object and function arguments
Because of spawn
being used on Windows, the launch of multiprocessing processes is really slow. It loads all the modules from scratch for each process on Windows.
Is there a way to speed up the creation of the extra processes on Windows? (using threads instead of multiple processes is not an option)