Atomicity of the simple assignment operator
问题 C11 Standard says that for atomic types (_Atomic), prefix and postfix ++ and -- operations are atomic (6.5.2.4.,p2), as are compound assignments: op= (6.5.16.2,p3). I haven't found anything written about a simple assignment = . Is it also atomic? Let's says E1, E2 are int , but only E1 is defined with the specifier _Atomic. My assumption is that this: E1 = E2; is equivalent to: atomic_store( &E1 , E2 ); It my assumption correct? 回答1: Following the example in this Dr Dobbs article, simple