In the effective java book, it states The language specification guarantees that reading or writing a variable is atomic unless the variable is of type long or double [jls, 17.4.7] Note that atomic is contextual In this case, the upsert operation only needs to be atomic with respect to operations on the answers table in the database The computer can be free to do other things as long as they don't affect (or are affected by) the result of what upsert is trying to do. Why the standard make that difference
It seems as both designate, in the same way, an atomic type. The atomic thing in shared_ptr is not the shared pointer itself, but the control block it points to Meaning that as long as you don't mutate the shared_ptr across multiple threads, you are ok Do note that copying a shared_ptr only mutates the control block, and not the shared_ptr itself. Std::atomic is new feature introduced by c++11 but i can't find much tutorial on how to use it correctly So are the following practice common and efficient
The definition of atomic is hazy The current wikipedia article on first nf (normal form) section atomicity actually quotes from the introductory parts above. Objects of atomic types are the only c++ objects that are free from data races I remember i came across certain types in the c language called atomic types, but we have never studied them So, how do they differ from regular types like int,float,double,long etc., and what are.
OPEN