overriding effect of -Bsymbolic, can TLSkey be helpful?

B

Bhawna

Hi,

We are using a multithreaded application which has a few dynamic
shared objects associated with it. We are running it on Linux
platform. Few of the classes and code part is common among main
executable and other DSOs. The DSOs have been linked using linker
option -Bsymbolic and so are able to keep their seperate objects for
common classes.

The issue we are having is we want to keep a true singleton of the
common class without disturbing current linker option. For this
purpose, we are allocating a new TLS key and putting this key into
environment, so that once initialised same object is used among all
DSOs. Based on what I read in man pages of pthread_key_create,
pthread_setspecific and pthread_getspecific, I can create a key as an
opaque object among multiple threads, but the values will still be
thread specific.

My specific questions in this scenario is:
1. Can I use TLS key-value pair common among multiple threads of an
application? If yes, can anybody please provide me any link to help me
on this?
2. Is there any other approach I can use to ensure that I have a
common object being shared among multiple threads belonging to
different DSOs, inspite of using -Bsymbolic linker option with DSOs?
3. Or is there any way to override the effect of -Bsymbolic linker
option for some specific symbols in any DSO, so as to ensure existence
of common symbols.

Any help in this regard willl be greatly appreciated.

Thanks and Regards
Bhawna
 
I

Ian Collins

Bhawna said:
Hi,

We are using a multithreaded application which has a few dynamic
shared objects associated with it. We are running it on Linux
platform. Few of the classes and code part is common among main
executable and other DSOs. The DSOs have been linked using linker
option -Bsymbolic and so are able to keep their seperate objects for
common classes.
Your questions look to be more platform than C++, better try a Linux
programming group.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top