New atomics not mentioned in /gcc-4.7/changes.html

Andrew MacLeod amacleod@redhat.com
Wed Feb 8 15:44:00 GMT 2012


On 02/08/2012 10:23 AM, Jonathan Wakely wrote:
> On 8 February 2012 13:06, Andrew MacLeod<amacleod@redhat.com>  wrote:
>> On 02/08/2012 05:54 AM, Richard Guenther wrote:
>>> On Wed, Feb 8, 2012 at 10:59 AM, Jonathan Wakely<jwakely.gcc@gmail.com>
>>>   wrote:
>>>> Should they be?
>>> Yes.  Esp. also the deprecation of the __sync builtins.
>> Yes, I meant to do that last week, but instead it's this week :-P     Gerald
>> had pinged me about it a while ago.
> Great, thanks - I was thinking about adding a line to the C++11
> improvements in the libstdc++ section mentioning the new
> implementation of<atomic>, do you think it's worth it?
Sure.   There are 2 benefits for c++ now

- We can compile atomic objects of any arbitrary size/type now.   
Previously there was a compiler error if it was not an integer class 
that mapped to a supported size of lock-free __sync call.  Now a user 
POD that is the same size as a supported integer will use the lock free 
instructions.

- If there is not a lock free sequence it becomes a library call.  
Although this release does not include an atomic library, I have made a 
sample source file available on the wiki which can be compiled and 
linked with code to resolve those library calls (using a locked 
implementation)  Its located in external library section of the wiki: 
http://gcc.gnu.org/wiki/Atomic/GCCMM

Andrew



More information about the Gcc mailing list