is reading a bool an atomic action?
if (value != true)//here I'm reading bool, then I'm comparing it to the value I'm interested in.
Also, how many processor cycles it takes to read it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The C++ standard doesn’t enforce any guarantees.
It depends on the processor, and it depends on where it’s being read from (disk swap vs. main memory vs. cache vs. register).