Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Sep 2010 13:31:46 +0300
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Alexander Pyhalov <alp@rsu.ru>
Cc:        freebsd-ports@freebsd.org, Alex Dupre <ale@freebsd.org>
Subject:   Re: libthr and libc
Message-ID:  <20100907103146.GB2465@deviant.kiev.zoral.com.ua>
In-Reply-To: <4C86115A.5070709@rsu.ru>
References:  <4C8600EE.4010000@rsu.ru> <4C860D9E.5030502@FreeBSD.org> <4C86115A.5070709@rsu.ru>

next in thread | previous in thread | raw e-mail | index | archive | help

--61jdw2sOBCFtR2d/
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Sep 07, 2010 at 02:18:02PM +0400, Alexander Pyhalov wrote:
> Thanks for explanation.
>=20
> 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 :)=
=20
> And one more interesting thing. I have a sample threaded application. On=
=20
> one system it was implicitly linked to libthr (on 8.0-stable), and on=20
> 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.

--61jdw2sOBCFtR2d/
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkyGFJEACgkQC3+MBN1Mb4gXmQCgyaSFKEkOtBW2gFVMi9I3JgNa
x0EAnRnerzymVF4ogzX9jW2ADbJtnbCt
=Z7oS
-----END PGP SIGNATURE-----

--61jdw2sOBCFtR2d/--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100907103146.GB2465>