From owner-freebsd-threads@FreeBSD.ORG Fri May 2 11:34:07 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 A6F4537B401 for ; Fri, 2 May 2003 11:34:07 -0700 (PDT) Received: from mail.chesapeake.net (chesapeake.net [205.130.220.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id DAB5943F85 for ; Fri, 2 May 2003 11:34:03 -0700 (PDT) (envelope-from jroberson@chesapeake.net) Received: from localhost (jroberson@localhost) by mail.chesapeake.net (8.11.6/8.11.6) with ESMTP id h42IXd518522; Fri, 2 May 2003 14:33:39 -0400 (EDT) (envelope-from jroberson@chesapeake.net) Date: Fri, 2 May 2003 14:33:39 -0400 (EDT) From: Jeff Roberson To: Peter Wemm In-Reply-To: <20030502002316.CB0BA2A7EA@canning.wemm.org> Message-ID: <20030502143129.N55924-100000@mail.chesapeake.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: threads@freebsd.org cc: Daniel Eischen Subject: Re: Question about rtld-elf. Anyone?.. Anyone? 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: Fri, 02 May 2003 18:34:07 -0000 On Thu, 1 May 2003, Peter Wemm wrote: > Daniel Eischen wrote: > > On Wed, 30 Apr 2003, Terry Lambert wrote: > > > Daniel Eischen wrote: > > > > > > > > When it hangs, there's no windowing, so no mouse. > > > > > > I mean load a page which would ordinary cause it to hang, and > > > don't move the mose at all while you wait for it to load. No > > > expose events means nothing else to run means effectively > > > single threaded. > > > > It doesn't *get* to the point of having *any* X-window open. > > In other words, I enter 'mozilla' at the prompt and see > > nothing at all. After some of my local hacks, it loads > > 1/2 of the time and once it is loaded, it never hangs. > > Here's a thought. Have a look at the _umtx_lock() and _umtx_unlock() > syscalls that were recently added, and the corresponding scaffolding in > libthr. Although this would likely break libc_r, it might be worth an > experiment to reimplement the ld-elf.so.1 spinlocks using that and see how > it goes. In the contested case, it would tsleep() the thread rather than > have it sit in a spinloop. Hmm. On second thoughts, this might not be > so easy since it needs a thread identifier. But have a peek anyway and > see if there is anything to be had from there.. > > Cheers, > -Peter I can't remember if we left thr_self() in the api but this call can be made from any application. The thread identifier is just the kva pointer to your thread structure. Actually, I'm almost certain that we left it in. umtx has one bug though, so be careful. Right now it uses the proc lock to protect the blocked thread queue. If casuptr faults while the proc lock is held we would recurse on it in the fault handler. Cheers, Jeff