[cfe-dev] atomic builtins

Chris Lattner clattner at apple.com
Tue May 5 13:06:24 PDT 2009


On May 5, 2009, at 12:50 PM, Howard Hinnant wrote:
>> Does anyone have an opinion on this?  I'm not exactly sure what is
>> required to get #1 working.  If that can't work, I tend to think that
>> #3 is best.
>
> I don't have an opinion on your question directly.  However I advise  
> when working this area to consider the C++ atomics interface as it  
> contains a C interface which WG14 (the C committee) is likely to  
> adopt (the two committees are attempting cooperation in this area).   
> The latest C++ spec can be found here:
>
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2857.pdf
>
> Search for "[atomics]".
>
> I am not (yet) terribly familiar with this part of the C++  
> standard.  But I know the authors well, and I know that their intent  
> is to create an interface that serves both C and C++ languages  
> equally well.  If there is latitude in the gcc spec which allows  
> aligning more closely with the C/C++ spec, I think it would be good  
> to take advantage of that latitude.

I think that these can be directly handled with library level support,  
and they are better thought out than the GCC builtins (e.g. they don't  
work for arbitrary pointer types, etc).  Supporting the two are pretty  
different.

-Chris



More information about the cfe-dev mailing list