Replying to @skydotcs
False sharing. Even though the threads access different variables, x and y are stored next to each other in memory within the same struct - CPUs use cache lines (usually 64 bytes) for efficiency:
- Thread 1 changes x, invalidating the cache line.
- CPU2 reloads the line to access





