fork() idea

Robert Collins
Mon Jan 28 19:48:00 GMT 2002

----- 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
> >little-or-nothing, and thus takes up almost no memory, has little
> >of dll conflicts, address relocation etc. Then allocate memory to
> >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
> 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 :]).


More information about the Cygwin-developers mailing list