This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Add atomic type qualifier
- From: Andrew MacLeod <amacleod at redhat dot com>
- To: Andi Kleen <andi at firstfloor dot org>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, hp at bitrange dot com
- Date: Fri, 26 Jul 2013 15:33:15 -0400
- Subject: Re: [PATCH] Add atomic type qualifier
- References: <51F2AEB1 dot 60408 at redhat dot com> <87ob9pm9gt dot fsf at tassilo dot jf dot intel dot com>
On 07/26/2013 03:01 PM, Andi Kleen wrote:
The way the standard is defined, any implicit operation like that is
seq_cst. If you want something other than seq-cst, you have to
explicitly call atomic_store (&x, 0, model).
Andrew MacLeod <firstname.lastname@example.org> writes:
What it doesn't do:
* It doesn't implement the C11 expression expansion into atomic
built-ins. ie, you can't write:
_Atomic int x;
x = 0;
and have the result be an atomic operation calling
__atomic_store (&x, 0).
How would this work if you want a different memory order?
C11 also provides all those same atomic routines that c++11 provides for
this reason. They just decided to try to implement the c++ atomic
templates in the language along the way :-P so it feels very much like