For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > January 2008 > overriding effect of -Bsymbolic, can TLSkey be helpful?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author overriding effect of -Bsymbolic, can TLSkey be helpful?
Bhawna

2008-01-30, 4:34 am

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


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com