-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
Avoid fork(3) - prefer vfork(2) #54
Comments
Fine IFF If so, you could use a wrapper application that does the file re-direct after vfork+exec. |
Looks good. Thanks! Could that happen in the first place though? On what POSIX OS + compiler is __USE_GNU not defined? Can that even happen? |
@x42 __USE_GNU is not defined on FreeBSD 11. There, <spawn.h> does not provide a flag that tells posix_spawn to prefer vfork(). |
Merged changes into devel branch: 4bef72f |
Removed github-issue-54 branch |
Available in the 1.1.11 release! |
The problem with fork() is that it duplicates the page tables and file-descriptors of the parent process. It is inherently not realtime-safe. Any processes that has realtime threads (here a plugin-host) should not use fork(). In context of pro-audio on POSIX systems, prefer
vfork(); execve();
https://github.com/sadko4u/lsp-plugins/blob/543e17e9de3b8dc9de6e31438d1223d792054626/src/ui/tk/widgets/LSPHyperlink.cpp#L107
PS. You may also investigate using
posix_spawn()
, but that's a library function on Linux.The text was updated successfully, but these errors were encountered: