08-22-04 11:08 PM
j0mbolar <j0mbolar@engineer.com> wrote:
> I've read that shared libraries are mapped into memory and shared amongst
> processes. If I have a program called "someapp" that uses a library called
> "foobar", and if I have eight instances of "someapp" running, then they al
l
> supposedly share "foobar". Which makes me wonder, this doesn't sound right
> because if I had a function in my library being shared which had a static
> buffer(say strtok for this example) then the individual processes would
> overwrite or share the data of the function in the shared library. So if
> this isn't correct, how then, is the library actually shared amongst many
> processes?
The text section (i.e. the code) of the libraries is shared between
processes using the library but not the data sections (e.g. static
buffers etc.), of this each process gets its own set.
Regards, Jens
--
\ Jens Thoms Toerring ___ Jens.Toerring@physik.fu-berlin.de
\__________________________ http://www.toerring.de
[ Post a follow-up to this message ]
|