Mailing-List: contact cygwin-developers-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT cygwin DOT com Delivered-To: mailing list cygwin-developers AT cygwin DOT com From: "Gary R. Van Sickle" To: Subject: RE: fork() idea Date: Tue, 29 Jan 2002 00:53:10 -0600 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: <04ce01c1a72e$2c597940$0200a8c0@lifelesswks> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal What about avoiding fork() entirely? I'm of course not talking about a general solution, but take sh for example; would it be possible to write a shell that simply never forks (or has it already been done)? That alone would be a massive win. Seems that one could simply (he sez) maintain a state stack where each time you see a "var=$(echo something | somethingelse)", instead of forking you'd just push a new shell state on the stack, spawn the commands, do the piping and other shell-things in the same process, pop the stack and Bob's yer uncle, no fork overhead. Or am I missing something fundamental? -- Gary R. Van Sickle Brewer. Patriot.