Recently, I am reading some Linux kernel space codes, I see this
uint64_t used; uint64_t blocked; used = atomic64_read(&g_variable->used); //#1
x86 CPUs don’t do read-after-read reordering, so it is sufficient to prevent the compiler from doing any reordering. On other platforms such as PowerPC, things will look a lot different.