Synchronization problem with posix_spawn

Peter Dons Tychsen donpedro@tdcadsl.dk
Mon Aug 3 09:10:10 GMT 2020


Hi all,

On Fri, 2020-07-31 at 10:10 +0200, Corinna Vinschen wrote:
> Oh well.  I did a quick test with your new testcase (thanks for
> that!)
> and it seems to be a bit more complicated than I anticipated
> yesterday.
> The parent-child relationship between the processes is broken.  I
> have
> to think a while about this problem, stay tuned.

I also have seen this problem. I propose a different solution however.
Why no get rid of the call to fork() all together. One of the things
bogging down performance on larger setups is the calls to fork() are is
inherently slow and should be avoided at all costs. Instead why don't
we just call spawn(vpe) instead, which is quite stable and fast.

This would give a _huge_ boost to e.g. larger build jobs. Make supports
posix_spawn, but it does not help on cygwin at it just calls back into
fork().

The current implementation is probably something that makes sense on
BSD/linux as fork() is lightning fast there.

Just an idea... 

/pedro




More information about the Cygwin mailing list