www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/02/01/18:52:08

From: cgf AT bbc DOT com (Christopher Faylor)
Subject: Fork speedup?
1 Feb 1998 18:52:08 -0800 :
Message-ID: <EnqD7D.FBu.cygnus.cygwin32.developers@bbc.com>
Reply-To: gnu-win32-developers AT cygnus DOT com
To: cygwin32-developers AT cygnus DOT com

It just occurred to me that fork might be a little faster if the
sequence of events was something like:

1) Parent calls CreateProcess with lpReserved2 set to a block of information
   containing memory regions to be copied to the child.

2) Parent waits for an event.

3) Child sets up handles, etc.

4) fork_init copies data and bss from parent.

4) heap_init sets up heap, copies heap.

5) dcrt0 extends stack and longjmps to cygwin_fork_helper.

6) cygwin_fork_helper copies parent's stack.

7) child signals parent.

8) child continues.

9) parent continues.

Is there a reason why the child can't do most of the work, avoiding
multiple WFMO/SetEvent's?  Information could be passed to the child
using a mechanism similar to Sergey's recent change to fd passing in
spawn_guts.
-- 
http://www.bbc.com/	cgf AT bbc DOT com			"Strange how unreal
VMS=>UNIX Solutions	Boston Business Computing	 the real can be."

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019