Synchronisation Patterns
The main concern when you deal with concurrency is shared, mutable state or as Tony Van Eerd put it in his CppCon 2014 talk “Lock-free by Example”: “Forget what you learned in Kindergarten (ie stop Sharing)”.
A necessary condition for a data race is a mutable, shared state. If you handle sharing or mutation, no data race can happen. This is exactly the focus of the next two sections: Dealing with Sharing and Dealing with Mutation.