Quantcast
Channel: Is it necessary to have atomic flags in multi-threaded code? - Stack Overflow
Browsing latest articles
Browse All 3 View Live

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 Article



Answer 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 Article

Is 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
Browsing latest articles
Browse All 3 View Live




Latest Images