delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/07/01/12:52:55

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_05,J_CHICKENPOX_52
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
Date: Wed, 01 Jul 2009 18:52:38 +0200
From: "Vincent R." <forumer AT smartmobili DOT com>
To: <cygwin AT cygwin DOT com>
Subject: Re: fork and exec (was: Re: Proposed patch to system.XWinrc)
In-Reply-To: <20090701160622.GB5802@ednor.casa.cgf.cx>
References: <416096c60906302255t1b5bdb41u442ebca20679c8d9 AT mail DOT gmail DOT com> <20090701151156 DOT GB335 AT ednor DOT casa DOT cgf DOT cx> <a4e34c72e377a41f991faec1244832fe AT mail DOT smartmobili DOT com> <20090701160622 DOT GB5802 AT ednor DOT casa DOT cgf DOT cx>
Message-ID: <7c085b629a9348d262d5339aff93c6d4@mail.smartmobili.com>
X-Sender: forumer AT smartmobili DOT com
User-Agent: RoundCube Webmail/0.2
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Wed, 1 Jul 2009 12:06:22 -0400, Christopher Faylor
<cgf-use-the-mailinglist-please AT cygwin DOT com> wrote:
> On Wed, Jul 01, 2009 at 05:32:14PM +0200, Vincent R. wrote:
>>On Wed, 1 Jul 2009 11:11:56 -0400, Christopher Faylor
>><cgf-use-the-mailinglist-please AT cygwin DOT com> wrote:
>>> On Wed, Jul 01, 2009 at 06:55:35AM +0100, Andy Koppe wrote:
>>>>2009/6/23 Christopher Faylor:
>>>>>>If posix_spawn() ever gets implemented in Cygwin to
>>>>>>avoid the slowness of fork(), /bin/sh might well change to the first
>>>>>>shell that supports it.
>>>>>
>>>>> It's really somewhat of an urban myth about Cygwin's fork being slow.
>>>>> Cygwin's exec is also pretty slow. ??I'm not really sure that
>>>>> posix_spawn
>>>>> would cause any kind of performance improvement.
>>>>
>>>>Ah, right. So is it Windows' CreateProcess() itself that's slow? Or is
>>>>it some of the additional stuff that exec() needs to deal with?
>>>>Signals? The hidden console?
>>> 
>>> The majority of the exec code is in spawn.cc - spawn_guts().  You can
>>> see for yourself that this is not a simple function.
>>> 
>>> Just remember that neither fork nor exec have native Windows analogues.
>> 
>>About that I wanted to make some benchmark with strace and give you
>>figures about cygwin running on Windows 7 64 bits and Windows XP 32
>>bits.Unfortunately I have only installed natively Windows 7 and I did
>>my test in a Virtual machine but I got some weirds figures where it was
>>also very slow on XP.  If some people have Windows XP and windows vista
>>(32 or 64 bits) on the same machine it could be interesting to provide
>>some benchmarks.
>>
>>and when I say benchmark I want exactly the same machine running the
>>same cygwin version or it won't be very relevant.
> 
> No one is asking for benchmarks! However, if we were, strace is
> particularly unsuitable for that task.  If you want to see improvements
> happen then dive into the code and offer specific suggestions.
> 
> cgf

I did but maybe it would be important to know for sure that the problem
comes from fork and
exec because I think you are sharing the same code with mingw and it runs a
lot faster with it.
So before I dive :

1) I want to be sure that fork/exec are the reason
2) See the differences with mingw.

I don't think there lots of different ways of implementing that two
functions




--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019