libthr and libc
kostikbel at gmail.com
Tue Sep 7 11:01:58 UTC 2010
On Tue, Sep 07, 2010 at 02:18:02PM +0400, Alexander Pyhalov wrote:
> Thanks for explanation.
> Alex Dupre wrote:
> >Simple explanation: the stubs are there because you can create a
> >thread-safe library and use it in a single-threaded or multi-threaded
> >program. Once linked to a multi-threaded program (with -pthread) the
> >library gets access to the real libthr implementations of the pthread_*
> >functions, while in the single-threaded program the library will use the
> >libc stubs without affecting performance.
> >If you encounter errors probably your program/libraries dynamically
> >loads shared libraries that link with libthr and so you eventually call
> >some pthread_* functions from libc and others from libthr.
> Yes, it was the case. And it was not rather simple to find out this :)
> And one more interesting thing. I have a sample threaded application. On
> one system it was implicitly linked to libthr (on 8.0-stable), and on
> other system (8.1-RELEASE) it had to be explicitly stated "-lpthr"...
Once I marked libthr as not loadable. It caused so much crying on the
lists that it had to be reverted. Apparently, people prefer to live with
the silent bugs instead of explicit reports.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20100907/d14ec863/attachment.pgp
More information about the freebsd-ports