*BSD News Article 5252


Return to BSD News archive

Newsgroups: comp.unix.bsd
Path: sserve!manuel!munnari.oz.au!uunet!mcsun!sun4nl!fwi.uva.nl!casper
From: casper@fwi.uva.nl (Casper H.S. Dik)
Subject: Re: Shared Libs for X11?, was Re: 386bsd -- The New Newsgroup
Message-ID: <1992Sep18.154038.29084@fwi.uva.nl>
Sender: news@fwi.uva.nl
Nntp-Posting-Host: adam.fwi.uva.nl
Organization: FWI, University of Amsterdam
References: <veit.716291291@du9ds3>> <1992Sep14.232949.9093@bby.com.au> <2aFn02vQ22Jx01@JUTS.ccc.amdahl.com> <Buo74w.Jp2@pix.com> <77aD02m3229d01@JUTS.ccc.amdahl.com>
Date: Fri, 18 Sep 1992 15:40:38 GMT
Lines: 45

gab10@cd.amdahl.com (Gary A Browning) writes:

>In article <Buo74w.Jp2@pix.com>, stripes@pix.com (Josh Osborne) writes:
> 
>> Runtime linked code will not allways be the same for each copy of the
>> same executable.  Not if we support a library path like Sun does (which
>> is a good idea), or if a new lib is installed after starting one copy of
>> xterm but before another is started.

>So am I correct in saying that the text is modified on initial load and,
>as long as the revisions of the libraries are the same for each new
>instantiation, the text is still sharable between process?

No. The text isn't modified on initial load, except when the shared
library wasn't properly constructed. (Which, incidentally, is the
case for most shared libraries around. (X11R4, openwin, X11R5
fixed 99% of the problems in X11R4 and only a few executables in the
X11R5 core have a problem (xman, ico, and ??)) The problem is also
caused by installing an updated libc.so without installing a libc.sa
with the same version number. 

In the cases were the text is modified on initial load, no sharing
of the modified pages is done. There is no mechanism that forces the
shared library to be loaded at the same postion. The way ld.so is
implemented makes the loading of the shared library depend on
RLIMIT_STACK.

>Note that this also implies that the binary image on disk is insuffient
>to use for recovering pages that have been removed from the processes'
>working set.  These processes will need to have space allocated in the swap
>space on disk and treated similarly to data pages (at least when initially
>removed from memory, then it never changes again so it will not need to
>be written out again).

When the text segment is no longer shared, swap space is allocated and
used as storage of the textsegment.
You will also see an increase in memory use. Two copies of
the same program will no longer share the text segment.

Casper

Casper
-- 
						|	Casper H.S. Dik
						|	casper@fwi.uva.nl