C++ memory operations, using atomics, targeted at a variable x.
std::atomic<int> x;
char cache[1024];
Thread 1:
memset(cache, 0, 1024);
x.store(20, std::memory_order::release);
Thread 2:
int z = x.load(std::memory_order::acquire);
char c = cache[20];
In this scenario, where the cache itself is not atomic, can we ensure that when thread 2 reads from cache, it will obtain the value written by thread 1?