[EMCpp]Item-40 Use std::atomic for Concurrency, volatile for Special Memory
· β 3 min read
std::atomic
is for data accessed from multiple threads without using mutexes (concurrent usage); volatile
is for memory where reads and writes should not be optimised away (special memory).