linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Hicham Mouline" <hicham@mouline.org>
To: linux-c-programming@vger.kernel.org
Subject: dlopen(3) many threads global variable
Date: Fri, 2 Jul 2010 18:14:08 +0100	[thread overview]
Message-ID: <i0l6p0$2g2$1@dough.gmane.org> (raw)

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, 




             reply	other threads:[~2010-07-02 17:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-02 17:14 Hicham Mouline [this message]
2010-07-03  8:06 ` dlopen(3) many threads global variable Glynn Clements

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='i0l6p0$2g2$1@dough.gmane.org' \
    --to=hicham@mouline.org \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).