From owner-freebsd-ports@FreeBSD.ORG Tue Sep 7 11:01:58 2010 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2667D10656A6 for ; Tue, 7 Sep 2010 11:01:58 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 8089A8FC16 for ; Tue, 7 Sep 2010 11:01:57 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o87AVkYM041241 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 7 Sep 2010 13:31:46 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o87AVkji093396; Tue, 7 Sep 2010 13:31:46 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o87AVkXn093391; Tue, 7 Sep 2010 13:31:46 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 7 Sep 2010 13:31:46 +0300 From: Kostik Belousov To: Alexander Pyhalov Message-ID: <20100907103146.GB2465@deviant.kiev.zoral.com.ua> References: <4C8600EE.4010000@rsu.ru> <4C860D9E.5030502@FreeBSD.org> <4C86115A.5070709@rsu.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="61jdw2sOBCFtR2d/" Content-Disposition: inline In-Reply-To: <4C86115A.5070709@rsu.ru> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.2 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-ports@freebsd.org, Alex Dupre Subject: Re: libthr and libc X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2010 11:01:58 -0000 --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/--