overriding effect of -Bsymbolic, can TLSkey be helpful?



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


.



Relevant Pages

  • Re: getenv, putenv
    ... Few of the classes and code part is common among main ... The DSOs have been linked using linker ... opaque object among multiple threads, but the values will still be ... inspite of using -Bsymbolic linker option with DSOs? ...
    (comp.os.linux.development.apps)
  • overriding effect of -Bsymbolic, can TLSkey be useful?
    ... Few of the classes and code part is common among main ... The DSOs have been linked using linker ... opaque object among multiple threads, but the values will still be ... inspite of using -Bsymbolic linker option with DSOs? ...
    (comp.os.linux.development.apps)
  • Re: Common code among main executable and shared objects
    ... common class without disturbing current linker option. ... a the TLS key index and instantiate pSingleton with already existing ... DSOs I chose to write it on Unix forum rather than c++. ...
    (comp.unix.programmer)
  • cannot compile on HPC SGI cluster
    ... I am attempting to compile MPI code on the High Performance Cluster, but am recieving errors that seem as if the compiler is not recognizing any of the MPI commands. ... Use linker option -v to see when and which objects, archives and dsos are loaded. ...
    (comp.parallel.mpi)
  • Common code among main executable and shared objects
    ... Few of the classes and code part is common among main ... The DSOs have been linked using linker ... The issue we are having is we want to keep a true singleton of the ... we are allocating a new TLS key and putting this key into ...
    (comp.unix.programmer)