Subject: Re: mapping shared memory at a fixed address
To: Rahul Kulkarni <>
From: Todd Vierling <>
List: netbsd-users
Date: 02/08/2005 23:10:23
On Tue, 8 Feb 2005, Rahul Kulkarni wrote:

> --- Eduardo Horvath <> wrote:

> > > this cannot work, due to a lot of duplication in the
> > > text and if if you fork a lot of children then the
> > > text  sizes will be a concern..
> >
> > Huh?  We're talking about a demand-paged VM.  Unless you're
> > writing to the text segment, it's shared.  Forking

> I meant unecassarily large address space issues due to
> duplication..

What duplication?  All code pages are *shared* across a fork (and even the
data pages are shared, until a write) -- meaning that there is no
duplication until the pages diverge in some way between the forked

In fact, fork()ing and not exec()ing (when you want to share a fixed-mapping
space) is actually *more* efficient for your purposes, because much of your
data and shlib link tables probably won't be written, and thus will remain
shared after the fork.

-- Todd Vierling <> <>