[cfe-dev] atomic intrinsics

John McCall rjmccall at apple.com
Mon Oct 18 10:19:08 PDT 2010


On Oct 18, 2010, at 9:11 AM, Howard Hinnant wrote:
> I checked with Lawrence Crowl concerning the C side.  The C spec currently says that different invocations of atomic_is_lock_free for the same pointer type may return different results.  Lawrence tells me that the C spec is based on an old C++ spec and is due to be changed to be consistent with C++.  Therefore I believe we're good to go with bool __atomic_is_lock_free(type).

Excellent.

> One question about Design A that has yet to be discussed is the possible defaulting of memory orderings in the intrinsics.  This defaulting, if it exists, is described at the very bottom of:
> 
> http://libcxx.llvm.org/atomic_design_a.html
> 
> I have no strong feeling either way.  I can easily live with or without the memory order defaults.  But I should either remove the "If desired" from the description (mandating the defaults), or remove the description of the defaults altogether (banning them).  Please weigh in with your opinions.

The defaulting scheme for the two-parameter versions is very complicated and precludes implementing the type-checking for these builtins with a single C++ function declaration.  If we're going to allow defaulting, I think they should both default to 5.

John.



More information about the cfe-dev mailing list