X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Eric Blake Subject: Re: optimizing fork/exec in vendor source Date: Fri, 10 Oct 2008 14:06:46 +0000 (UTC) Lines: 37 Message-ID: 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 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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: List-Subscribe: List-Archive: List-Post: List-Help: , 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 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/