Subject: Re: mapping shared memory at a fixed address
To: Rahul Kulkarni <crypto_rahul@yahoo.com>
From: Todd Vierling <tv@duh.org>
List: tech-kern
Date: 02/08/2005 23:10:23
On Tue, 8 Feb 2005, Rahul Kulkarni wrote:
> --- Eduardo Horvath <eeh@NetBSD.org> 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
processes.
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 <tv@duh.org> <tv@pobox.com>