Understanding acquire-release example from book C++ concurrency in action
Could you, please, explain why assert can fire? I cannot understand the explanation below. Both if(y.load...
and if(x.load...
use std::memory_order_acquire
. Is not this enough? In the book it’s written that we need seq_cst for assert not to fire. How does seq_cst
improve here?
Future is not returning reference to value in C++
I’ve just started learning multi-threading in C++ and following this excellent tutorial.
Start thread with member function
I am trying to construct a std::thread
with a member function that takes no arguments and returns void
. I can’t figure out any syntax that works – the compiler complains no matter what. What is the correct way to implement spawn()
so that it returns a std::thread
that executes test()
?