ideas about threading lib switching

Matthew Dillon dillon at apollo.backplane.com
Wed Apr 11 10:16:15 PDT 2007


:Hey,
:
:I think we all agree that we want to have the ability to switch between t=
:hreading libs.  But for this not to result in chaos, it must be guarantee=
:d that only one of the threading libs is used in one process.
:
:Additionally, I'd like it to be easily switchable, on a per-run basis pro=
:bably.  So I was thinking of something like this:
:
:Have a generic "proxy" lib called libpthread.so.0 or so, which defines th=
:e available functions and where all binaries can be linked against.  This=
: lib however does not provide any functionality.  Instead, there would be=
: some way that this lib (or rtld, or so)  decides on execution time (or w=
:henever it is being runtime linked) which real threading lib to load.  So=
:me sort of objformat, just for libs.
:
:However, I don't know how we can do this.  Does anybody have input, ideas=
:?  One way would be to use rtld/libmap, like in FreeBSD, but I don't 100%=
: like this approach.  I'd like to find something more elegant.  But I'm k=
:ind of stuck here, maybe somebody has some ideas to contribute?
:
:Did I even make sense or made myself clear?
:
:cheers
:  simon

    I don't think we need to go that far.  I just meant we wanted the
    option of linking against one library or the other when the program
    is linked with -pthread, perhaps with an environment variable.

						-Matt





More information about the Kernel mailing list