I heard that a single atomic operation is thread-safe because when a core is processing an atomic operation the core wouldn't be doing anything else before it completes that atomic operation .
for example in java in a 32 bit operating system say there is a variable accessible to multiple Threads
int a;
thread 1 write in a
a = 3;
and thread 2 can write
a = 4;
the order of the threads writing to that variable may change so the final value can either be 3 or 4 but we can be sure that writing to an int is an atomic operation so the 32 bits in that variable won't be mixed up in to some unpredictable number
I get that this is the case in a single core environment since the core would not be executing a code of another thread before it is sure that the atomic operation is complete,
however in a multi core environment isn't it possible that another core accesses the variable that is under an atomic operation of the current core? thus causing the 32bits in the variable to get mixed up?