-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
fork support #8295
Comments
See JuliaLang/libuv#19 and the other PRs referenced therein (for some related discussion). |
fork has no equivalent on windows (which is why it doesn't exist in libuv – only things that can be done on all platforms are allowed) |
On 09/11/2014 04:53 AM, Jameson Nash wrote:
Yes, though allowing an existing process to restart libuv wouldn't be a Forking is quite a big deal for several performance tweaks. |
I would be supportive of having non-portable features as long as it's clear that they are not portable. |
Threading in libraries is an issue you may need to consider. For example, OpenBLAS creates its own threads. These will not be active in the forked child. |
On 09/11/2014 11:38 AM, Amit Murthy wrote:
Good point, though I was more worried about open IPC handles after the |
it's worth noting here that C doesn't even support |
On Fri, Mar 25 2016, Jameson Nash notifications@github.com wrote:
I'm not sure I follow. |
|
On Fri, Mar 25 2016, Jameson Nash notifications@github.com wrote:
Well, yes, but it's a bit of a stretch. But does this hint that we're getting true multithreaded runtime support |
We're already using many libraries with true multihread support. |
I know that this issue has been closed as won't fix, but I'd like to point out that supporting |
|
I don't have much choice. The C library on which |
What's the reason it uses |
The parallelization model used in
|
That's an understandable reason, but that fails to take into account that many programs can't be |
One (potentially) very nice application of
" In any case, my point is that Obviously, I like to write flippantly, but hopefully there's something useful here. cheers, nehal |
I was trying to look into how much work would be to support fork() in julia as a first class operation.
fork would be needed for higher performance mutli-processing #7616, #985 thanks to a shared initial memory state.
I'd like to discuss 2 things here: what the fork semantics should be and the actual implementation details.
What should be the state of open file descriptors after a fork? Similarly, what should be do with current tasks?
Ideally fork would return pid, stdout and stderr to the forked process, while adding the PID to the current list of managed processes. The list of pending tasks would be reset on the child process (as you obviously don't want to continue tasks in the new environment), as for the list of managed processes (as there would be 2 processes managing the same pids). File descriptors coming from libuv are already marked FD_CLOEXEC, so there should be nothing much to do here.
libuv doesn't support forking (there's no uv_fork). However, re-initializing libuv from scratch on the child process looks do-able if we also aim to reset any pending task anyway.
Is there anything that's escaping me?
The text was updated successfully, but these errors were encountered: