-
-
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
Rename spawn
function
#25965
Comments
I like the keyword argument one. |
I believe that makes |
Since |
The keyword argument could be |
Another option: let this be type unstable and return the process only when |
Alternate idea:
|
|
After starting to work on implementing this, using |
add `read` and `write` keyword arguments to `open` for processes fixes #25965
add `read` and `write` keyword arguments to `open` for processes fixes #25965
add `read` and `write` keyword arguments to `open` for processes fixes #25965
add `read` and `write` keyword arguments to `open` for processes fixes #25965
add `read` and `write` keyword arguments to `open` for processes fixes #25965
add `read` and `write` keyword arguments to `open` for processes fixes #25965
add `read` and `write` keyword arguments to `open` for processes fixes #25965
add `read` and `write` keyword arguments to `open` for processes fixes #25965
add `read` and `write` keyword arguments to `open` for processes fixes #25965
"If you're forking a subprocess I don't think you care much about a little type instability" I would like type stability in general; or that is no allocations, e.g. for that function. [Any idea if allocations/type instability is common in the standard library; at least in basic functions where is seemingly could be avoid?] Maybe I'm mistaken about the reason: it even happens (in 0.5) for type stable functions (always a problem with type instability?), as I get in the global scope, even for @time trivial_function() "4 allocations: 160 bytes". I'm thinking of real-time use of Julia. Then you want no allocations, and even some few exceptions with low amounts could derail it (and low/infrequent is easy to miss). Of course spawn would allocate memory for the new process, but shouldn't need to do it for the current one? [In general, debugging, or preventing allocations/GC is a broader issue than this one; I'm just thinking, can this be done here?] |
Type stability and allocations are separate issues, only sometimes related. The approach we ended up implementing here is in fact type stable, but still needs to allocate a process object. I don't think allocating a tiny process object should be a big deal, when you're already doing something as heavyweight as starting a new process in a multi-tasking OS. Real-time GCs exist, so even real-time applications do not entirely rule out memory allocation. |
add `read` and `write` keyword arguments to `open` for processes fixes #25965
So this is breaking for |
nvm, I believe |
The
spawn
function is the same as therun
function but non-blocking, it runs the process in the background.The better known
@spawn
macro, is used to run a function on a different julia process.While conceptually related they are not related in any practical sense.
I suggest that
spawn(cmd)
should be deprecated to something likerun_background(cmd)
,or to
run(cmd; background=true)
The text was updated successfully, but these errors were encountered: