-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
consider loky for CPU parallelization #18
Comments
Can you explain what you mean by not needing Right now it seems that the overhead of CPU parallelism is small, and i'm initially inclined to stick with the standard library solution, but am open to arguments to change it. I have not personally had any problem with the current solution. |
gosh, I just mentioned this in a comment on PR #20 as well (totally forgetting about loky at that time) using hiding the multiprocessing step behind I do not know why this is only a problem on windows machines, but I can say from personal experience that the effect is real (just try running NISE in for reasons that I also do not understand, I get the impression that the builtin it's all over my head right now, so I don't know what the advantages or disadvantages of moving to we could always switch our CPU multiprocessing implementation conditional of |
actually, I think I was getting confused about examples I saw that were using so yeah, at the moment it seems like @ksunden if you think it's best to just live with the gotcha that's fine with me---after all this seems to be understood expected behaviour on windows, and it seems foolish to make things vastly more complicated under the hood in the pursuit of a slightly simpler api if we leave the gotcha in, I think mp should be off by default 😞 |
I am starting to understand why this happens, has to do with the way forking is handled. POSIX-like systems have well defined process forking at the kernel level, allowing for an immediate fork. Windows' implementation relies on spawning new instances of the interpreter from scratch. What I'm unclear of is whether this remains a problem if the multiprocessing call is done within layers of function calls in different namespaces. It sound's like you are saying it does present itself as such. |
It is pretty common, and I believe considered standard practice, to surround code in files to be run as scripts with My current inclination remains to encourage this behavior, as it ensures that users' learn good habits. This is not a particularly firm inclination, however, and I am still mulling over what makes the most sense to me. Perhaps when I get the chance to run on Windows, I may change my mind... |
loky
among other advantages... no need for if
__name__ == "__main__"
(on windows machines...)The text was updated successfully, but these errors were encountered: