linux-mips
[Top] [All Lists]

Re: patches for test-and-set without ll/sc (Re: thread-ready ABIs)

To: "Jason Gunthorpe" <jgg@debian.org>
Subject: Re: patches for test-and-set without ll/sc (Re: thread-ready ABIs)
From: "Kevin D. Kissell" <kevink@mips.com>
Date: Tue, 22 Jan 2002 19:19:55 +0100
Cc: <linux-mips@oss.sgi.com>
References: <Pine.LNX.3.96.1020122110419.20690A-100000@wakko.deltatee.com>
Sender: owner-linux-mips@oss.sgi.com
> On Tue, 22 Jan 2002, Kevin D. Kissell wrote:
> 
> > The idea leverages off the fact that a branch likely
> > instruction performs a kind of conditional execution.
> > The instruction in the delay slot is executed only if
> > the branch is taken.  This can be used to synthesize
> > a conditional store.  The user level code for a simple
> > atomic increment, for example, would look something
> > like this:
> 
> Hmm, could you use this to take the race out of the kernel wait loop 
> too? Ie use current->need_resched as the test and 'wait' as the
> conditional operation.

It's quite possible.  But remember that it won't work on
an R3000.  R39xx yes, but not an R3K "classic".

            Kevin K.


<Prev in Thread] Current Thread [Next in Thread>