From owner-freebsd-hackers@FreeBSD.ORG Sun Mar 26 02:01:03 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 827EE16A422; Sun, 26 Mar 2006 02:01:03 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4434143D48; Sun, 26 Mar 2006 02:01:03 +0000 (GMT) (envelope-from davidxu@freebsd.org) Received: from localhost.my.domain (root@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k2Q2116O025838; Sun, 26 Mar 2006 02:01:02 GMT (envelope-from davidxu@freebsd.org) From: David Xu To: freebsd-threads@freebsd.org Date: Sun, 26 Mar 2006 10:00:51 +0800 User-Agent: KMail/1.8.2 References: <44215FE9.2070602@highway.ne.jp> <20060324084834.GE27116@deviant.kiev.zoral.com.ua> <20060325100729.00713045@kan.dnsalias.net> In-Reply-To: <20060325100729.00713045@kan.dnsalias.net> MIME-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200603261000.52100.davidxu@freebsd.org> Cc: Kostik Belousov , freebsd-hackers@freebsd.org, Alexander Kabaev Subject: Re: [patch] Re: dlopen() and dlclose() are not MT-safe? YES, esp. for libthr X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2006 02:01:03 -0000 =D4=DA Saturday 25 March 2006 23:07=A3=ACAlexander Kabaev =D0=B4=B5=C0=A3=BA > The thread mask only makes sense when flags are per-thread. I meant > to use it to detect PLT recursions from locking primitives exported to > rtld by the threads library as those are not allowed and threads > implementations are required to take special care to provide only > self-contained locks.=20 >=20 > The 'default' lock implementation will not work with any library > other than libc_r, and even that holds true only for some definition of > "work". The dynamic loader never had a reliable locking and > furthermore, there was no way to make it work better without threading > library cooperation. This is why we came up with a set of callbacks > rtld expects every threading library to provide. libpthread was the > first where these callbacks were implemented. It comes as a surprise > that libthr did not have them, because David Xu was the one who did > most of the work on rtld locking callbacks in libpthread. >=20 > The def_thread_set_flag function use is racy and should be fixed. >=20 > --=20 > Alexander Kabaev I have fixed it in libthr yesterday, I think I must forgot to do it in the past. Regards, David Xu