delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/06/12/22:33:06

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
Message-ID: <42ACF184.E58BC2A8@dessent.net>
Date: Sun, 12 Jun 2005 19:37:56 -0700
From: Brian Dessent <brian AT dessent DOT net>
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Making /bin/sh == bash. Has the time come?
References: <20050610150729 DOT GA13181 AT trixie DOT casa DOT cgf DOT cx>
X-Spam-Report: -5.5/5.0 ---- Start SpamAssassin results * -3.3 ALL_TRUSTED Did not pass through any untrusted hosts * -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% * [score: 0.0000] * 0.4 AWL AWL: From: address is in the auto white-list ---- End SpamAssassin results
X-IsSubscribed: yes
Reply-To: cygwin AT cygwin DOT com

Christopher Faylor wrote:

> Recently, after too many hours hacking at vfork corner cases, I came to
> the conclusion that getting vfork working correctly was too difficult
> so, I turned off vfork in cygwin and asked Corinna to modify ash to use
> /bin/sh again.

I assume that should read "modify ash to use fork() again."

Can I just ask a basic question here?  So if both ash and bash are using
the same method of execution (fork), is the reason for bash's slowness
due to it just being a larger program with more pages to copy during a
fork()?

And a related question: Would it make more sense to compile ash with all
its builtins enabled, rather than switching to bash?  It seems from the
benchmarks that bash loses in speed due to its large size, but wins a
lot back by having builtins that it can use for many features.  If
ash+builtins is still smaller than bash, wouldn't it solve both
problems?  (Of course if configure scripts choose bash automatically if
present, then that sort of throws a wrench in that logic.)

Final question: It seems to me that most of what a shell does for most
common things is essentially "fork(); ... exec(); ... wait();".  I'm
sure there's an obvious reason why the following is not feasible, but
would it be possible to special case this in the shell to use something
that maps closer to the win32 api like spawn() so as to avoid having to
fork()?

Brian

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