-
Notifications
You must be signed in to change notification settings - Fork 102
Note multiprocessing start method compatibility #529
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -67,6 +67,23 @@ run: | |||||||||||||||||||||
...: a | ||||||||||||||||||||||
Out[3]: array([1., 1., 1., 2., 2., 2., 3., 3., 4., 4.]) | ||||||||||||||||||||||
|
||||||||||||||||||||||
Multiprocessing | ||||||||||||||||||||||
~~~~~~~~~~~~~~~ | ||||||||||||||||||||||
|
||||||||||||||||||||||
While not supported or guaranteed to be stable, PyJulia tends to work | ||||||||||||||||||||||
with the multiprocessing library if the correct `start method | ||||||||||||||||||||||
<https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods>`_ | ||||||||||||||||||||||
is selected: *fork* (default on Unix) segfaults with with `unknown | ||||||||||||||||||||||
function` errors, while *spawn* (default on Windows and MacOS) generally, | ||||||||||||||||||||||
but not always, runs without memory allocation issues. To select *spawn*, | ||||||||||||||||||||||
include the line | ||||||||||||||||||||||
Comment on lines
+76
to
+79
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Just using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wish I could, but I haven't done extensive enough testing to say why it happens. I've just noted that it does occasionally happen in my use case. @davidavdav is this something you've also experienced? |
||||||||||||||||||||||
|
||||||||||||||||||||||
.. code:: python | ||||||||||||||||||||||
|
||||||||||||||||||||||
multiprocessing.set_start_method('spawn') | ||||||||||||||||||||||
|
||||||||||||||||||||||
once in your code prior to using the multiprocessing library. | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
@davidavdav does that sound right? |
||||||||||||||||||||||
|
||||||||||||||||||||||
PyJulia does not release GIL | ||||||||||||||||||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||||||||||||||||||||||
|
||||||||||||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.