After reading "Concurrency in action" I could not find an answer to one question - are there guarantees in the standard for reading side effects when we have one store(release) and many loads(acquire) on one atomic variable? Suppose we have:
int i{};
atomic<bool> b{};
void writer(){
i=42;
b.store(true,memory_order_release);
}
void reader(){
while(!b.load(memory_order_acquire))
this_thread::yield();
assert(i==42);
}
//---------------------
thread t1{writer},t2{reader},t3{reader};
If we had only one reader, all ok, but can we have failed assertion in t2 or t3 thread?