Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: pgh@fetch.unx.dec.com (Paul Henderson)
Subject: Re: Do multiple processes running same program share memory?
Date: 1996/02/16	[thread overview]
Message-ID: <4g2gge$3r8@zk2nws.zko.dec.com> (raw)
In-Reply-To: 31223D7B.4C09@pweh.utc.com

Pete Bradley (bradlepc@pweh.utc.com) wrote:
: If I have multiple processes running the same program
: on a single alpha running OSF (Er...Digital Unix ;-),
: will the text of the program be shared in memory? 

: The program in question has 5 Mb of text and will be
: running on a 4-CPU Sable.

:                       Pete Bradley
:                       Pratt & Whitney


I asked our technical director who is a kernel whiz, and he said:

Yes, the code sections and any shared library code sections will only
physically exist once, all applications will map in those physical
pages.  For data sections, they are loaded "virgin" from the disk and as
long as they haven't been modified, all applications share a "read only"
copy of the pages, once an application tries to do something (like x++)
a page fault occurs and a separate physical copy of the page is made for
the process doing the write.  This is typically done on a page-by-page
basis. So, if you run a HUGE program with HUGE data multiple times you
only take the hit for it once until each program starts writing its own
data then it starts splitting off till there are two complete copies
(still share the code segments).




           reply	other threads:[~1996-02-16  5:00 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <31223D7B.4C09@pweh.utc.com>]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox