svn commit: r230201 - head/lib/libc/gen

David Chisnall theraven at FreeBSD.org
Thu Jan 19 18:30:53 UTC 2012


On 19 Jan 2012, at 18:09, Ed Schouten wrote:

> In the very nearby future (after I switch SPARC64 and MIPS to
> libcompiler_rt), it should be possible to safely use C11's <stdatomic.h>
> on all supported architectures. The C11 interface allows any operation
> to be combined with any type of barrier.
> 
> Maybe we should simply migrate this code to use <stdatomic.h> then?

Currently, that will give worse code if we use gcc 4.2.1, but (I hope!) better code if we use clang.  With GCC, we are implementing atomic_thread_fence() as __sync_synchronize(), which is a full barrier, and ignoring its argument.  It would probably be worth postponing any such migration until:

1) Clang is the default compiler, and
2) The bugs in LLVM that cause the back end to fatal error on any nontrivial code using atomics are fixed.

David


More information about the svn-src-head mailing list