Say we have two threads, one is reading a bool in a loop and another can toggle it at certain times. Personally I think this should be atomic because sizeof(bool)
in C++ is 1 byte and you don't read/write bytes partially but I want to be 100% sure.
So yes or no?
EDIT:
Also for future reference, does the same apply to int
?