From owner-freebsd-threads@FreeBSD.ORG Mon May 5 22:54:41 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 B9C5237B401 for ; Mon, 5 May 2003 22:54:41 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 03F2D43F3F for ; Mon, 5 May 2003 22:54:41 -0700 (PDT) (envelope-from eischen@pcnet1.pcnet.com) Received: from pcnet1.pcnet.com (localhost [127.0.0.1]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h465seBg011951; Tue, 6 May 2003 01:54:40 -0400 (EDT) Received: from localhost (eischen@localhost)h465saVR011942; Tue, 6 May 2003 01:54:38 -0400 (EDT) Date: Tue, 6 May 2003 01:54:36 -0400 (EDT) From: Daniel Eischen To: Terry Lambert In-Reply-To: <3EB73DA9.B0F0C647@mindspring.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: David Xu cc: threads@freebsd.org Subject: Re: Patch for running Java2D demo (jdk-1.4.1p3_3) 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: Tue, 06 May 2003 05:54:42 -0000 On Mon, 5 May 2003, Terry Lambert wrote: > > Daniel Eischen wrote: > > > > Personally, I don't think this is justifiable, and that the > > > > problem is actually a coding error in the threaded program, > > > > with failure to comply with the POSIX and Single UNIX > > > > Specification when writing your threaded program. The pthreads > > > > documentation seems to back me up (Chapter 12 of "Go Solo 2", > > > > as well as Corrigenda). > > > > > > It *is* an rtld-elf problem. I've protected dlfoo() all with the > > > same mutex and it still hangs. rtld-elf uses spinlocks in > > > areas that aren't called by dlfoo(). > > Rather than pointing at the standards over and over again, it > occurs to me that I should ask you a question, instead, to > emphasize our disconnect; so here it is: > > If my theory of operation for the bug was incorrect, > can you tell me *why* my suggested scheduler workaround > fixed it, instead of having no effect or only a partial > effect? I'm assuming it is when a library/symbol is needed (not via dlopen()), rtld-elf goes off and does whatever it has to to find/load the symbol/library. It takes an internal read or write lock. Then whatever thread it was running in gets swapped out and another thread gets run. This thread perhaps causes other symbols to be referenced or perhaps does a dlopen() and causes the lock to be taken again. Read the rtld-elf source if you don't believe me. -- Dan Eischen