From owner-freebsd-hackers Wed Aug 7 9:37: 1 2002 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 D624637B400 for ; Wed, 7 Aug 2002 09:36:58 -0700 (PDT) Received: from mail.pcnet.com (pcnet1.pcnet.com [204.213.232.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id 565C643E6A for ; Wed, 7 Aug 2002 09:36:58 -0700 (PDT) (envelope-from eischen@mail.pcnet.com) Received: (from eischen@localhost) by mail.pcnet.com (8.12.3/8.12.1) id g77GavpD003986; Wed, 7 Aug 2002 12:36:57 -0400 (EDT) Date: Wed, 7 Aug 2002 12:36:57 -0400 (EDT) From: Daniel Eischen Message-Id: <200208071636.g77GavpD003986@mail.pcnet.com> To: hackers@freebsd.org, jdp@polstra.com Subject: Re: Help needed. Deadlock in rtld makes openoffice build hang ag Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > I agree completely about spinlocks vs. mutexes, in principle. But ... > the reason the rtld uses its own spinlock implementation is because > it cannot assume that the threads package is libc_r. It could be > linuxthreads or some completely unknown threads package. I don't > like the current solution in the rtld, but it's hard to come up with > something that works with arbitrary threads packages. As long as all threads packages that we want to support have pthread_mutex_lock/pthread_mutex_unlock, then you can just use a weak reference to them (and pthread_mutex_init I guess too) and use them when present. Both libc_r (under -current anyways) and linuxthreads use weak definitions from pthread_* to _pthread_* (or __pthread_* in Linux I think), so that might throw a wrench into this solution. I'm not sure how weak references to weak definitions work. [ I may have reversed my use of weak reference and definitions, but _you_ should be able to figure out what I meant. ] -- Dan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message