I learned last month that when the CPU reads from memory, it reads a whole cache-line of 64 bytes (could be different depending on architecture).
Does it do the same when writing ?
If so, do I have to take care not to write nearby variables without mutex protection. Example:
typedef struct object_S
int memberA; // writable only by thread A (running on CPU 0)
int memberB; // writable only by thread C (running on CPU 1)
object->memberA = 10;
object->memberB = 60;
On a multiple processor system, can one CPU (running thread A) update memberA to 10, then the other CPU (running thread B) update memberB to 60 without worrying to overwrite memberA with an old/oudated value. I would be doing this without mutex protection.