Concurrency lets a program do more than one thing at a time. This
module starts with threads: how to start a function on a new
std::thread, wait for it with join, and the different ways
to create threads in C++11.
It then covers what goes wrong when threads share data. A race condition happens when two threads change the same value at the same time, and a mutex protects that shared data so only one thread uses it at once. The last lesson shows std::async, an easier way to run work in parallel and collect the result.
Watch the lessons in order, then continue on to Build Systems & Debugging.
How to run a function on a separate thread with std::thread and wait for it to finish with join.
The different ways to create a thread in C++11: function pointers, lambdas, functors and member functions.
What a race condition is, why it breaks programs that share data between threads, and how a mutex fixes it with a worked example.
Using std::async and futures to spread work across CPU cores, and what to watch for when threads share results.