Compiler memory barrier
These barriers prevent a compiler from reordering instructions, they do not prevent reordering by CPU.
The GNU inline assembler statementasm volatile("" ::: "memory");
or even__asm__ __volatile__ ("" ::: "memory");
forbids GCC compiler to reorder read and write commands around it.[5]
学习了. |