This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: help abt loading a shared library.


On Thu, 11 Jul 2002, Arunachalam G. stipulated:
> is it possible to make a shared library to be in memory for ever. the

With any Unix modern enough to understand shared libraries at all, no,
but it's also unnecessary.

> situation is a shared library XYZ.so.0.0.1 is used often by all of the
> clients in the network through a web interface.
> can i make this library to be present in memory forever? so that the
> invoked program does't take time to load it.

If you use it a lot, it'll stay in memory, shared between processes :)
the OS knows more about the global state of your machine at runtime than
you do at compile-time; this is the OS's job. Not even the shared
version of the C library takes special measures to stay in memory, and
on modern Unixes it tends to be used by just about *everything*.

(In the olden days you used to be able to turn on the sticky bit for a
binary to say `keep it in memory'; but this stopped working over a
decade ago, and rightly so.)

> is there any obivious mistake in doing it. if not please help me how to do
> so.

Don't bother to try :) the OS can do it all for you.

-- 
`There's something satisfying about killing JWZ over and over again.'
                                        -- 1i, personal communication


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]