Answer by Phil Miller for Read a variable in another thread
You can indeed just declare it as std::atomic<int>, and things should work as you want.volatile is about preserving the sequence of addresses and values that the generated code must present to...
View ArticleRead a variable in another thread
I'm using linux and I have two variable that is read/write in another thread. Once in a while (100ms) ThreadB reads the status of the variables and does something. It's basically a while(1){...
View Article
More Pages to Explore .....