Skip to content
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

doc: note that fork() and exec() are unrelated to Unix system calls, resolves #224 #1718

Closed
wants to merge 3 commits into from

Conversation

Trott
Copy link
Member

@Trott Trott commented May 17, 2015

This is a conservative attempt to resolve #224.

@Trott Trott changed the title child_process: note in docs that fork() and exec() are unrelated to Unix system calls, resolves #224 doc: note in docs that fork() and exec() are unrelated to Unix system calls, resolves #224 May 17, 2015
@Trott Trott changed the title doc: note in docs that fork() and exec() are unrelated to Unix system calls, resolves #224 doc: note that fork() and exec() are unrelated to Unix system calls, resolves #224 May 17, 2015
@brendanashworth brendanashworth added the doc Issues and PRs related to the documentations. label May 17, 2015
@rlidwka
Copy link
Contributor

rlidwka commented May 17, 2015

Instead of the "unrelated" disclaimer it's probably better to explain what the difference is.

@Trott
Copy link
Member Author

Trott commented May 17, 2015

Instead of the "unrelated" disclaimer it's probably better to explain what the difference is.

Perhaps. I at least initially concluded that including the differences between them is a little like including the differences between JavaScript and Java in the documentation. Despite a similar name, there really is not much of a relationship. And many of the similarities are coincidental.

@Fishrock123
Copy link
Contributor

Perhaps change "unrelated" to "not similar" or "dissimilar"?

@rlidwka
Copy link
Contributor

rlidwka commented May 17, 2015

Note: child_process.fork() works differently from the fork() system call in POSIX, it starts a new node.js process instead of cloning a current one.

Note: child_process.exec() works differently from the exec() system call in POSIX, it doesn't stop current process like an exec() does.


I don't remember what those system calls do, but something along those lines would be better.

@Trott
Copy link
Member Author

Trott commented May 18, 2015

Yes, that's an improvement. Thanks! I'll keep a watch here and over at #224 and try to pull together the best bits and pieces in the next few hours hopefully...

@Trott
Copy link
Member Author

Trott commented May 18, 2015

OK, I've updated the text based on feedback from @rlidwka, @guss77 and others. What do we think of this? I'm trying to provide more information than just saying they're different, but also trying to keep it succinct.

Unlike the exec() POSIX system call, child_process.exec() does not replace the existing process and uses a shell to execute the command.

Unlike the fork() POSIX system call, child_process.fork() does not clone the current process.

@guss77
Copy link

guss77 commented May 18, 2015

I would be happier if it would include slightly more details, but can live with this as it is.

@silverwind
Copy link
Contributor

I wish such meta-information would be a bit visually distinct from actual behaviour documentation. You don't have to change unless you agree, but I'd like to see these two paragraphs italicized (wrap in *).

@rlidwka
Copy link
Contributor

rlidwka commented May 19, 2015

but I'd like to see these two paragraphs italicized (wrap in *).

+1

@Trott
Copy link
Member Author

Trott commented May 19, 2015

I've italicized it and also prefixed it with "Note:".

silverwind pushed a commit that referenced this pull request May 20, 2015
Adds notes about the difference to their POSIX counterparts.

PR-URL: #1718
Fixes: #224
Reviewed-By: Roman Reiss <me@silverwind.io>
@silverwind
Copy link
Contributor

Thanks, landed in 86dd244

@silverwind silverwind closed this May 20, 2015
@rvagg rvagg mentioned this pull request May 23, 2015
andrewdeandrade pushed a commit to andrewdeandrade/node that referenced this pull request Jun 3, 2015
Adds notes about the difference to their POSIX counterparts.

PR-URL: nodejs/node#1718
Fixes: nodejs/node#224
Reviewed-By: Roman Reiss <me@silverwind.io>
@Trott Trott deleted the fork-exec branch January 29, 2019 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename ChildProcess exec and fork to something which is not entirely confusing to system developers
6 participants