_Atomic
摘要
C has the _Atomic keyword that allows the creation of atomic variables that can be used instead of mutexes in some cases for lock-free yet still thread-safe multithreaded programming. This chapter covers the _Atomic keyword, atomic library functions, memory barriers, compare-and-swap, lock-free operations, the “ABA Problem,” versioned pointers, and false sharing.