Answer by Revolver_Ocelot for Using std::condition_variable with atomic
I looked through your code manipulating conditional variable and atomic, and it seems that it is correct and won't cause problems.Why you should protect writes to shared variable even if it is...
View ArticleAnswer by Yakk - Adam Nevraumont for Using std::condition_variable with atomic
In general, you want to treat the fact that variable is atomic independently of how it works with a condition variable.If all code that interacts with the condition variable follows the usual pattern...
View ArticleAnswer by jonezq for Using std::condition_variable with atomic
atomic data doesn't need another synchronization, it's basis of lock-free algorithms and data structures.void do_pause_test_threads(SomeClass *someclass){ if (!someclass->pause_test_threads) { ///...
View ArticleUsing std::condition_variable with atomic
There are several questions on SO dealing with atomic, and other that deal with std::condition_variable. But my question if my use below is correct?Three threads, one ctrl thread that does preparation...
View Article
More Pages to Explore .....