When do I really need to use atomic<bool> instead of bool? [duplicate]
问题 This question already has an answer here: Can a bool read/write operation be not atomic on x86? [duplicate] 3 answers Do I have to use atomic<bool> for “exit” bool variable? 3 answers Isn\'t atomic<bool> redundant because bool is atomic by nature? I don\'t think it\'s possible to have a partially modified bool value. When do I really need to use atomic<bool> instead of bool ? 回答1: No type in C++ is "atomic by nature" unless it is an std::atomic* -something. That's because the standard says so