This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2] nptl: optimize cancelstate and canceltype changing
- From: Richard Henderson <rth at twiddle dot net>
- To: Alexander Fyodorov <halcy at yandex dot ru>, "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>, Carlos O'Donell <carlos at redhat dot com>, David Miller <davem at davemloft dot net>
- Date: Mon, 16 Jun 2014 07:52:08 -0700
- Subject: Re: [PATCH v2] nptl: optimize cancelstate and canceltype changing
- Authentication-results: sourceware.org; auth=none
- References: <180951402831608 at web26g dot yandex dot ru> <539DF667 dot 4070101 at twiddle dot net> <5358221402901764 at web9h dot yandex dot ru>
On 06/15/2014 11:56 PM, Alexander Fyodorov wrote:
> If CAS is atomic, then "a" will equal 2. But if CAS is implemented via spinlock, the write from CPU0 could happen in between the load and the store that comprise CAS, and "a" will equal 1 which is wrong.
Ah, I mis-read the original patch, wherein I thought you were declaring a local
lock for the write. Sorry for the noise.
r~