Answer by freakish for Is it necessary to have atomic flags in multi-threaded...
What happens is that this change may not be reflected in running threads immediately.What happens is that this is an undefined behaviour. The compiler is allowed to do pretty much anything with...
View ArticleAnswer by Maxim Egorushkin for Is it necessary to have atomic flags in...
When std::mutex/pthread_mutex_t and std::condition_variable/pthread_cond_t are used to communicate with the thread the flag shouldn't be atomic because it must be stored to and loaded from only when...
View ArticleIs it necessary to have atomic flags in multi-threaded code?
I was wondering if it is really necessary to have atomic flags in a multi-threaded code. For this problem, I focus on a common situation in multi-thread code: stopping threads by setting a flag.Let's...
View Article
More Pages to Explore .....