This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Using __kuser_cmpxchg
- From: Paul Brook <paul at codesourcery dot com>
- To: linux-arm-kernel at lists dot arm dot linux dot org dot uk
- Cc: Nicolas Pitre <nico at cam dot org>, Andrew Haley <aph-gcc at littlepinkcloud dot com>, java at gcc dot gnu dot org
- Date: Fri, 16 Nov 2007 00:25:01 +0000
- Subject: Re: Using __kuser_cmpxchg
- References: <200711151759.lAFHxKa4027497@devserv.devel.redhat.com> <18236.45845.426395.147581@zebedee.pink> <alpine.LFD.0.9999.0711151631350.21255@xanadu.home>
> > > In the mean time you can work around it by using a mutex around the
> > > thread state modification instead of using cmpxchg on it. Or if your
> > > platform is ARMv6 or higher then you won't get those spurious false
> > > negatives.
> >
> > Ah, OK, that's interesting: it sounds like you understand under what
> > circumstances it may fail "spuriously".
>
> Heh, I wrote that code (and comment). :-)
>
> > What are these?
>
> On a pre-ARMv6 processor
Similar "spurious" failures can happen on ARMv6 processors.
ARMv6 cpus don't have atomic operations either. They have ldrex/strex, where
the latter will fail if another CPU modifies the memory *or* a context switch
occurs.
Paul