I have a few questions about cache lines.
We have two variables in the same cache line, a and b.
Thread 1 reads a and thread 2 reads b.
We know that both threads read the entire cache line (they both read a and b).
But, thread 1 modifies a and thread 2 modifies b.
- Do both threads write the entire cache line to the main memory ?
and if they do does it cause to other variables in the same cache line to change ? - do cache lines have mutual exclusion for reading and writing ?