Well, then we have to use locks for protecting read/write access of larger data types and structures in shared memory.
I take it, that acquiring/spinning/releasing of that locks would be perfectly suited for atomic operations.
e.g.
struct {
bool_t lock;
char str[256];
uint64_t u64;
double f64;
} shared_memory_t;
I am not 100% clear about the QorIQ chips cache coherency and SMP. I read something about cache line size of an e5500 core being 64 bytes long.
Is wrapping shared data access with an atomic lock enough to ensure cache coherency of the data too?
e.g.
Once we have acquired the lock (probably by an atomicCas), do we also have to use atomic operations to manipulate the data elements in order to ensure cache coherency of the data elements?
Or can the data get manipulated by whatever means needed and the final atomic operation to release the lock (probably an atomicSet) would ensure cache coherency of the lock and data?
thanks