linux-mips
[Top] [All Lists]

Re: [libc-alpha] Re: PATCH: Fix ll/sc for mips

To: Kaz Kylheku <kaz@ashi.footprints.net>
Subject: Re: [libc-alpha] Re: PATCH: Fix ll/sc for mips
From: "H . J . Lu" <hjl@lucon.org>
Date: Thu, 31 Jan 2002 23:10:36 -0800
Cc: Hiroyuki Machida <machida@sm.sony.co.jp>, macro@ds2.pg.gda.pl, libc-alpha@sources.redhat.com, linux-mips@oss.sgi.com
In-reply-to: <Pine.LNX.4.33.0201311952440.2305-100000@ashi.FootPrints.net>; from kaz@ashi.footprints.net on Thu, Jan 31, 2002 at 08:02:25PM -0800
References: <20020201.123523.50041631.machida@sm.sony.co.jp> <Pine.LNX.4.33.0201311952440.2305-100000@ashi.FootPrints.net>
Sender: owner-linux-mips@oss.sgi.com
User-agent: Mutt/1.2.5i
On Thu, Jan 31, 2002 at 08:02:25PM -0800, Kaz Kylheku wrote:
> On Fri, 1 Feb 2002, Hiroyuki Machida wrote:
> > Please note that "sc" may fail even if nobody write the
> > variable. (See P.211 "8.4.2 Load-Linked/Sotre-Conditional" of "See 
> > MIPS RUN" for more detail.) 
> > So, after your patch applied, compare_and_swap() may fail, even if
> > *p is equal to oldval.
> 
> I can't think of anything that will break because of this, as long
> as the compare_and_swap eventually succeeds on some subsequent trial.
> If the atomic operation has to abort for some reason other than *p being
> unequal to oldval, that should be cool.

Maybe we should document it in glibc, something like

compare_and_swap compares the contents of a variable with an old value.
If the values are equal and a new value is stored in the variable
atomically, 1 is returned; otherwise, 1 is returned.


H.J.

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