Dealing with Sharing -- Rainer Grimm
If you don’t share, no data races can happen. Not sharing means that your thread works on local variables. This can be achieved by copying the value, using thread-specific storage, or transferring the result of a thread to its associated future via a protected data channel.
Dealing with Sharing
by Rainer Grimm
From the article:
The patterns in this section are quite obvious, but I will present them with a short explanation for completeness. Let me start with Copied Value. If a thread gets its arguments by copy and not by reference, there is no need to synchronize access to any data. No data races and no lifetime issues are possible.
Data Races with References
The following program creates three threads. One thread gets its argument by copy, the other by reference, and the last by...

Registration is now open for CppCon 2023! The conference starts on October 1 and will be held
There are many well-established patterns used in the concurrency domain. They deal with synchronization challenges such as sharing and mutation but also with concurrent architectures. Today, I will introduce and dive deeper into them in additional posts.
Nico Josuttis gave a talk recently that included an example and I wanted to explain what’s going on in this example, what the issue is, and what (if anything) is broken.
Registration is now open for CppCon 2023! The conference starts on October 1 and will be held
Registration is now open for CppCon 2023! The conference starts on October 1 and will be held
C language was defined to cover a large range of computer architectures, including many which would be considered museum relics today. It therefore takes a very conservative view of what is permitted, so that it remains possible to write C programs for those ancient systems. (Which weren’t quite so ancient at the time.)
Registration is now open for CppCon 2023! The conference starts on October 1 and will be held