-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
std.process.Child: use clone() instead of fork() #22368
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?
Conversation
0b61b7d
to
57ee91d
Compare
|
6f31e98
to
351ce97
Compare
I use |
2ac3a31
to
0713379
Compare
@alexrp PTAL. |
e88bb54
to
f57a745
Compare
Probably not. The workaround can be removed once that bug has been fixed. By the way, I'm not particularly familiar with the actual process management logic in |
@andrewrk Would you plz have a look? |
Hai there, I also wrote an implementation of Additionally, if it's for perfomance reasons I also don't fully understand. Looking at godbolt, the handrolled assembly is certainly better, but I personally don't see how losing 5 or so instructions offsets the additional complexity, but again perhaps I'm misunderstanding. Would love your feedback :) |
The point is that you must use asm to perform stack switching. Yes, it's probably okay to use Similar to |
It is because you have a mistake in your code. It should be: const rc = std.os.linux.syscall2(.clone3, @intFromPtr(args), @sizeOf(ClArgsDummy)); instead of: const rc = std.os.linux.syscall2(.clone3, @intFromPtr(&args), @sizeOf(ClArgsDummy)); |
I see, thanks a lot for your explanation. Your implementation is much more solid, and I won't have much time in the near future so I will close my PR. Good luck getting this merged :) |
otherwise libc may silently ignore some RT signals for NPTL
The comment syntax is not supported by both gcc and zig
See discussions in #1620.
This PR depends on #22341.(merged)