From owner-freebsd-threads@FreeBSD.ORG Thu Jun 5 10:13:28 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6210F37B404 for ; Thu, 5 Jun 2003 10:13:28 -0700 (PDT) Received: from heron.mail.pas.earthlink.net (heron.mail.pas.earthlink.net [207.217.120.189]) by mx1.FreeBSD.org (Postfix) with ESMTP id D2FAC43FA3 for ; Thu, 5 Jun 2003 10:13:27 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from user-38lc0tv.dialup.mindspring.com ([209.86.3.191] helo=mindspring.com) by heron.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19NyIh-0002LX-00; Thu, 05 Jun 2003 10:13:21 -0700 Message-ID: <3EDF76E2.E06C3003@mindspring.com> Date: Thu, 05 Jun 2003 09:59:14 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Daniel Eischen References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a4823f00e542c5b38941a04ddd829abae5350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c cc: Kern Sibbald cc: freebsd-threads@freebsd.org Subject: Re: FreeBSD pthread_equal "bug" X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2003 17:13:28 -0000 Daniel Eischen wrote: > On Thu, 5 Jun 2003, Terry Lambert wrote: > > So's not explicitly protecting dlopen(), and so's not forcing > > I never committed anything that protected dlopen(), and > > rescheduling of the thread that was running at preemption time, > > when returning from an involuntary preemption. ;^). > > also never committed anything to do this either. > > The rtld-elf fixes were not specifically related to dlopen(). > Binding of objects was not thread-safe even if dlopen() was not > used. I'm surprised; I thought this was being done explicitly for dlopen() support. For just the regular use of shared libraries, a trivial workaround is to change the behaviour from RTLD_LAZY to RTLD_NOW, which would ensure that all bindings are completed beforeany threads are started (at least, until .init sections or static constructors for C++ objects in some libraries end up starting threads). I was aware that you had been holding off on the scheduling, but the rtld changes being made seemed schitzophrenic with regard to an overall policy of not making changes to protect applications from their programmers. If this is the case, I withdraw my objections to the ld.so changes to support locking and/or an order of operation change. I still think it's an optimization to avoid RTLD_NOW behaviour on shared library startup, more than anything else, but it's a reasonable optimization. You learn something new every day... -- Terry