X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D08A5385703F
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1596445816;
	bh=lqwcuAf7+X8lVr14Qn6DZqqMm+2l5SiiPW7Y6KHBC6s=;
	h=Subject:To:Date:In-Reply-To:References:List-Id:List-Unsubscribe:
	 List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
	 From;
	b=OpsPiY2fn7GemfgQ1OgkDG5VhyExuhyB74phCuo7cLq6DVVzVuezqzMBxAijEKCia
	 Q69DKcW9dsBuWQYoza+wEhdfhwRMmtOfRV2WW122RsFGCeeMVY52hcC58rQr5MuSsp
	 xbaFw8OkbUrORP4rDBReLU+C7NoFc5GO35mQpimA=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 426413857C42
Message-ID: <9c44f4351d459a2ba8d27c65bf71679208cb13d6.camel@tdcadsl.dk>
Subject: Re: Synchronization problem with posix_spawn
To: cygwin@cygwin.com
Date: Mon, 03 Aug 2020 11:10:10 +0200
In-Reply-To: <20200731081025.GB460314@calimero.vinschen.de>
References: <b1992e8b-d2e8-9c44-8f93-a270d5a879ed@cornell.edu>
 <864b3031-9fc8-beb3-ba7c-1ade4c31a288@cornell.edu>
 <20200730115913.GL4206@calimero.vinschen.de>
 <20200730171723.GA460314@calimero.vinschen.de>
 <86051625-646d-065a-8543-1c3086411d3d@cornell.edu>
 <20200731081025.GB460314@calimero.vinschen.de>
User-Agent: Evolution 3.36.4 (3.36.4-1.fc32)
MIME-Version: 1.0
X-yse-mailing: LEGIT
X-yse-spamcause: OK,
 (0)(0000)gggruggvucftvghtrhhoucdtuddrgeduiedrjeeggdduudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfvffevpdggtfgfpffufgeuufevtffkuefgpdfqfgfvnecuuegrihhlohhuthemuceftddtnecunecujfgurhepkffuhffvffgjfhgtfggggfesthejredttderjeenucfhrhhomheprfgvthgvrhcuffhonhhsucfvhigthhhsvghnuceoughonhhpvggurhhosehtuggtrggushhlrdgukheqnecuggftrfgrthhtvghrnheptdeigfegueduveekvdegfeeufeeihfegledvkeevieeiheffiedtkeeuiedtjeffnecukfhppedutddrvdeirddvvdeirddufedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehhvghlohepmhifuhhmfhdtfedtjedpihhnvghtpedutddrvdeirddvvdeirddufedupdhmrghilhhfrhhomhepughonhhpvggurhhosehtuggtrggushhlrdgukhdprhgtphhtthhopegthihgfihinhestgihghifihhnrdgtohhm
X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00, DKIM_SIGNED,
 DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE,
 RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS,
 TXREP autolearn=ham autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
 server2.sourceware.org
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Peter Dons Tychsen via Cygwin <cygwin@cygwin.com>
Reply-To: Peter Dons Tychsen <donpedro@tdcadsl.dk>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cygwin-bounces@cygwin.com
Sender: "Cygwin" <cygwin-bounces@cygwin.com>

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


--
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
