delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/10/10/01:26:27

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <2cf50a010810092225q1d7190e6k8f8a4f152fce4de4@mail.gmail.com>
Date: Fri, 10 Oct 2008 16:25:39 +1100
From: "Jack Andrews" <effbiae AT gmail DOT com>
To: cygwin AT cygwin DOT com
Subject: optimizing fork/exec in vendor source
MIME-Version: 1.0
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

hi guys,

i think cygwin is great, and i'd like it to be more useful to me.  my
work for the past year has been porting daemons to windows.  so i'm
familiar with the fork problem.  i've read a little about how cygwin
does a lot of work to make fork work.  -- and to make it work without
having to change the source from the vendor.  i think maybe the vendor
might be changed to make small changes to their source so that cygwin
will run a lot better.

a little example that illustrates cygwin's fork efficiency is:

$ time ls >/tmp/out

real    0m0.131s
user    0m0.062s
sys     0m0.015s

$ time for x in `cat /tmp/out`; do ls -d $x; done >/dev/null

real    0m3.512s
user    0m0.378s
sys     0m0.915s

which kind of kills some simple shell scripts.

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()?
 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).



ta, jack

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