Re: [PATCH] fmt-merge-msg: avoid open "-|" list form for Perl 5.6
- From
- Christopher Faylor <me@cgf.cx>
- Date
- Feb 26, 2006, 20:40 UTC
- Message-ID
- <20060226204027.GC30735@trixie.casa.cgf.cx>
- In-Reply-To
- <Pine.LNX.4.64.0602261217080.22647@g5.osdl.org>
On Sun, Feb 26, 2006 at 12:18:19PM -0800, Linus Torvalds wrote:
Show 7 quoted lines
>On Sun, 26 Feb 2006, Christopher Faylor wrote: >>If the speed of cygwin's fork is an issue then I'd previously suggested >>using spawn*. The spawn family of functions were designed to emulate >>Windows functions of the same name. They start a new process without >>the requirement of forking. > >I thought that cygwin didn't implement the posix_spawn*() family?
Right. It just implements the windows version of spawn. I looked more closely at the posix_spawn functions after you last suggested it and, while it would be possible to implement this in cygwin, these functions are a lot more heavyweight than the windows-like implementation of spawn that are already in cygwin. So, they would come with their own performance penalty.
The cygwin/windows version of spawn is basically like an extended version of exec*():
pid = spawnlp (P_NOWAIT, "/bin/ls", "ls", "-l", NULL);
will start "/bin/ls" and return a pid which can be used in waitpid. There is still some overhead to this function but it basically is just a wrapper around the Windows CreateProcess, which means that it doesn't go through the annoying overhead of Cygwin's fork.
The posix_spawn stuff is in my todo list but the Windows spawn stuff could be used now.
cgf