delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/10/10/08:22:09

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
X-Authority-Analysis: v=1.0 c=1 a=hrSImO8NJtUA:10 a=xe8BsctaAAAA:8 a=2DUH_JavqfZlTWLLWZsA:9 a=wnfLwaYsL9JHRmcgehn4NGmUhMkA:4 a=eDFNAWYWrCwA:10 a=rPt6xJ-oxjAA:10
Message-ID: <48EF48B2.8070603@byu.net>
Date: Fri, 10 Oct 2008 06:21:06 -0600
From: Eric Blake <ebb9 AT byu DOT net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.17) Gecko/20080914 Thunderbird/2.0.0.17 Mnenhy/0.7.5.666
MIME-Version: 1.0
To: cygwin AT cygwin DOT com, effbiae AT gmail DOT com
Subject: Re: optimizing fork/exec in vendor source
References: <2cf50a010810092225q1d7190e6k8f8a4f152fce4de4 AT mail DOT gmail DOT com>
In-Reply-To: <2cf50a010810092225q1d7190e6k8f8a4f152fce4de4@mail.gmail.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Jack Andrews on 10/9/2008 11:25 PM:
> in the example, i guess all that is done is to fork and exec ls,
> grabbing its stdout.  this can be done with CreateProcess() easily
> without having to emulate everything that fork does.  so my real
> question is, has anyone tried optimizing fork/exec to CreateProcess()?

No, changing bash to use CreateProcess is not the answer.  The real
question is whether someone with copyright assignment is willing to write
posix_spawn[p], and write it more efficiently than forking, at which
point, bash should be patched to take advantage of it, at least when
exec'ing subprocesses (it won't help the other common case where bash
truly must fork, such as in creating subshells, but might speed up the
execution of child processes).

>  and would the maintainers of (eg. bash) accept a patch for use with
> cygwin?  (so i wouldn't have to continually forward port my fork/exec
> code).

You are welcome to post whatever patch you'd like.  But in the case of
bash, if the patch uses native Windows calls, I'm very unlikely to either
apply it or to pass it upstream, as it would just be a maintenance
nightmare, not to mention too risky of breaking posix semantics by going
behind cygwin's back.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9 AT byu DOT net
volunteer cygwin bash maintainer
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkjvSLIACgkQ84KuGfSFAYBYLwCfQgLOwpuMvvxODEhTBQmDlbiW
wK0AoIqgLSaFj4vF6QM1ieKA/73Xlt8N
=ipVN
-----END PGP SIGNATURE-----

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

- Raw text -


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