Answer by eerorika for why use std::atomic if it still requires a mutex to...
why use std::atomic if [condition variable] still requires a mutex to work properlyThere is no reason to use an atomic condition variable.What is the use for atomicsEven if atomics aren't useful for...
View ArticleAnswer by paddy for why use std::atomic if it still requires a mutex to work...
The semantics of a conditional wait necessitates the use of a mutex.This is because there is a potential race condition on the thread that is testing the condition. When this thread is checking whether...
View Articlewhy use std::atomic if it still requires a mutex to work properly
Reading the text for std::condition_variable I've come across this sentence:Even if the shared variable is atomic, it must be modified under the mutex in order to correctly publish the modification to...
View Article
More Pages to Explore .....