On Mon, 17 Feb 2025, Corinna Vinschen wrote: > The requirements of posix_spawn and their helper functions are so > that we can't easily fulfill them without doing the fork/exec > twist. > > See https://man7.org/linux/man-pages/man3/posix_spawn.3.html. > Windows CreateProcess() is not quite the same as Linux clone(). > > However, if you think you can come up with a version only running the > spawnve function and thus speed up Cygwin, feel free to send patches.
(based on my recollections rather than actually reading the docs again...) Specifically, maybe the case where the attributes which are supposed to do things effectively between fork and exec are not set could be fast-pathed to use spawn/CreateProcess, and the more complex cases fall back to fork/exec. If the created process is also a Cygwin process, perhaps the actions that are supposed to happen between fork and exec could happen in the startup code (much like fork emulation). Just brainstorming. BTW, I vaguely remember an issue with GNU make in MSYS2, where we found that making it *not* use posix_spawn made it faster. https://github.com/msys2/MSYS2-packages/blob/a0902f1e21781022c5ceca44c64190998a62e048/make/PKGBUILD#L31-L32 -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple