-
-
Notifications
You must be signed in to change notification settings - Fork 663
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
ENH: fix Python multi-processing hang on unix #2649
Conversation
Am I understanding correctly that with this PR, when a fork occurs, the all threads are terminated in the parent, and new threads are recreated in both new processes? I would expect the parent keeps it's threads and the child process "abandons" the parents threads and keeps new ones. |
That might be possible, but with more experimentation/effort. The only thing I know of which forks with ITK is Python multiprocessing. And I am trying to address a hang in this situation, with minimal effort. Stopping and cleaning up the thread pool before the fork greatly simplifies the reasoning. |
I guess that #1948 is a blocker for this. Now waiting for that to be done before continuing work on this. |
@blowekamp you are right! Changing return to imwrite avoids pickling, thus allowing me to verify this fix works. I cleaned it up as per Hans' and Matt's suggestions. Please re-review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
Applied to the |
Closes #2069.
Initial (old) description:
This turns a hang into: