* dlopen(3) many threads global variable
@ 2010-07-02 17:14 Hicham Mouline
2010-07-03 8:06 ` Glynn Clements
0 siblings, 1 reply; 2+ messages in thread
From: Hicham Mouline @ 2010-07-02 17:14 UTC (permalink / raw)
To: linux-c-programming
Hello,
There is a .so shared dynamic library the main source file of which contains
a global variable.
In my main funtion, I call dlopen() on the same .so file from 16 different
threads. I do nothing to ensure the call is not done at the same time.
Very roughly speaking (and please can you provide precision if possible),
the executable code of the .so file is loaded into the main process virtual
memory after the dlopen has succeeded. (Note the main binary is not linked
against the .so file)
Will there be 16 copies of the executable code from the .so file in the
process?
IN particular, will there be 16 copies of the global variable?
Regards,
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: dlopen(3) many threads global variable
2010-07-02 17:14 dlopen(3) many threads global variable Hicham Mouline
@ 2010-07-03 8:06 ` Glynn Clements
0 siblings, 0 replies; 2+ messages in thread
From: Glynn Clements @ 2010-07-03 8:06 UTC (permalink / raw)
To: Hicham Mouline; +Cc: linux-c-programming
Hicham Mouline wrote:
> There is a .so shared dynamic library the main source file of which contains
> a global variable.
>
> In my main funtion, I call dlopen() on the same .so file from 16 different
> threads. I do nothing to ensure the call is not done at the same time.
>
> Very roughly speaking (and please can you provide precision if possible),
> the executable code of the .so file is loaded into the main process virtual
> memory after the dlopen has succeeded. (Note the main binary is not linked
> against the .so file)
>
> Will there be 16 copies of the executable code from the .so file in the
> process?
No.
> IN particular, will there be 16 copies of the global variable?
No.
--
Glynn Clements <glynn@gclements.plus.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-07-03 8:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-02 17:14 dlopen(3) many threads global variable Hicham Mouline
2010-07-03 8:06 ` Glynn Clements
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).