Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: cannot dlopen non-loadable /usr/lib/libpthread.so.1



On Sun, Feb 13, 2011 at 05:00:41PM +0100, Thomas Klausner wrote:
> For I: Do you mean the solution is not to link zlui-gtk.so against
> libpthread? (If it links in gtk, I don't think it can do that without
> libpthread.)

Consider libsqlite3.so as canonical example. It doesn't itself use
pthread_create and just references e.g. the mutex functions. Those exist
as weak stubs in libc, so that a thread-aware library can use them.
If libpthread is not linked into the main program, the stubs provide
cheap short cuts for single-threaded programs. It doesn't work for
everything, but calls to pthread_create are a good decision point.

Joerg


Home | Main Index | Thread Index | Old Index