This is the mail archive of the cygwin-developers@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: More spawn & Windows processes


On Mon, Dec 27, 2004 at 07:02:37PM -0500, Pierre A. Humblet wrote:
>At 06:57 PM 12/27/2004 -0500, Christopher Faylor wrote:
>>On Mon, Dec 27, 2004 at 02:34:05PM -0500, Pierre A. Humblet wrote:
>>>You could also set the pipe as inheritable for execs, as proposed
>>>earlier.  That makes sync_proc_pipe unnecessary.  Having a
>>>"set_proc_pipe_inheritance" would not be any more complicated (code
>>>wise).  It would also not be slower than duplicating the pipe into the
>>>exec'ed process.
>>
>>Making the pipe inheritable brings us back to the scenario of having a
>>parent process wait for all children of an exec'ed non-cygwin process.
>>I'd rather avoid that now that we have a way to avoid it.
>
>I had in mind what we discussed earlier.  On spawn and fork, duplicate
>the pipe non inheritable (as today).  Make it inheritable just before
>an exec.  When starting the execed process make it non inheritable
>again.

If you make the pipe inheritable then cygwin will wait for progeny of
every non-cygwin process.  That is exactly what the current code is
trying to avoid.

>You objected that it had to be made non inheritable on exec
>CreateProcess failure.  That's true, but it looks like a small price to
>pay, compared to starting suspended.

I doubt that anyone would even notice the overhead of starting in
suspended state.  I could never see a difference in my timings on my SMP
WinXP box where I'd expect it to make a difference.  The predominating
factor in process creation seems to be fork.  However, I'm only doing it
for the Win9x family.

The tradeoff is people complaining because cygwin waits for things that
it shouldn't vs. people actually noticing that there is a few hundred
microseconds (if that) worth of difference when a process is exec'ed.

cgf


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]