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 Message-ID: <036201c1a852$88fcfb70$0200a8c0@lifelesswks> From: "Robert Collins" To: References: <04ce01c1a72e$2c597940$0200a8c0 AT lifelesswks> <20020128170138 DOT GA3669 AT redhat DOT com> Subject: Re: fork() idea Date: Tue, 29 Jan 2002 10:21:37 +1100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-OriginalArrivalTime: 28 Jan 2002 23:21:30.0428 (UTC) FILETIME=[8458C7C0:01C1A852] === ----- Original Message ----- From: "Christopher Faylor" > On Sun, Jan 27, 2002 at 11:28:48PM +1100, Robert Collins wrote: > >Just running this past for criticism. > > > >What if on fork(), we loaded a _trivial_ stub program, what depends on > >little-or-nothing, and thus takes up almost no memory, has little chance > >of dll conflicts, address relocation etc. Then allocate memory to look > >like the parent, load .dll's etc. > > I've toyed with this from time to time but I don't think it is a win. > When you do a fork with the current implementation all of the text > section will be read from memory and all of the data section will be > copied from disk. Ok, can the text section be done via COW? > If you just start a stub, then you have to get the text section from > somewhere. AFAIK, you can't remap the memory from one process to > another so you actually have to read from disk. You could map it in but > I don't think that is guaranteed to be read directly from memory. I'm suggesting that the text section and data section are read into a named shared memory segment, thus allowing them to be mapped straight in (and as the parents text section is in the same mapped area, it will come from memory (as the parent is in memory :]). Rob