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

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Eric Blake <ebb9 AT byu DOT net>
Subject: Re: optimizing fork/exec in vendor source
Date: Fri, 10 Oct 2008 14:06:46 +0000 (UTC)
Lines: 37
Message-ID: <loom.20081010T135704-373@post.gmane.org>
References: <2cf50a010810092225q1d7190e6k8f8a4f152fce4de4 AT mail DOT gmail DOT com> <48EF48B2 DOT 8070603 AT byu DOT net> <2cf50a010810100626j74c804a4m6ce87dfc0f284505 AT mail DOT gmail DOT com>
Mime-Version: 1.0
User-Agent: Loom/3.14 (http://gmane.org/)
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

Jack Andrews <effbiae <at> gmail.com> writes:

> 
> eric wrote:
> > 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,
> 
> this seems to be an easy problem in cygwin (at least, in comparison to fork).

Not so fast.  Yes, it is easy to write posix_spawn on top of fork; gnulib has 
done just that:
http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=shortlog;h=12d62c3

But what is not easy is writing posix_spawn without using fork, in order to 
optimize by using the Windows notion of spawning processes, but while still 
maintaining all other POSIX semantics that cygwin processes need.  In other 
words, gnulib's solution, while it works for cygwin, is no better than fork.  
cgf has already commented on this list (and in fact, even Linus Torvalds has 
mentioned it on the git list) about the potential for speedups with a proper 
posix_spawn, and the difficulty of getting there:
http://sourceware.org/ml/cygwin/2006-11/msg00380.html

You're also forgetting that patching bash to use posix_spawn, while useful in 
its own right, is not trivial (the upstream bash maintainer will probably 
accept such a patch only if it has sane fallbacks onto a fork implementation 
for other systems that lack posix_spawn, but he doesn't use gnulib, nor does he 
post his development repository publicly).

> who has to hold the copyright?

http://cygwin.com/contrib.html
http://cygwin.com/assign.txt

-- 
Eric Blake



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