Can I use <stdatomic.h> from C11 in the Linux driver, or should I use Linux functions for memory barriers?

Can I use #include <stdatomic.h>and atomic_thread_fence()with memory_orderof C11 in the Linux driver (kernel space), or should I use the Memory function:

Using:

  • Linux-kernel 2.6.18 and higher
  • GCC 4.7.2 or more
+3
source share
2 answers

, C C, ( gcc). , mainline ( , ), Linux. , , .

: linux.

+6

EDIT: , . , . , lib NOP


, .

atomic_store() atomic_load() , . , , .

  : intelfreq.c / Core_Cycle() corefreqd.c / Core_Cycle()

+1

All Articles