Is concurrent non-atomic read and write on variables of C++ fundamental types (multiple reads and multiple writes) an undefined behavior in C++? I don't care about the actual value, as later I will find out if concurrent read/write has happened and if so, I ignore the current value. I just want to know if the behavior is well-defined C++?
If it is well-defined, is it still well defined if Thread 1 reads/writes x and Thread 2 reads/writes y in, where x and y are members of the following union?
union {
int x;
double y;
};