In this chapter, we've discussed the concept of concurrency and showed the difference between parallelism. We learned the difference between a process and a thread, the latter being of interest. Multithreading allows us to manage a program to be more efficient, though it also brings additional complexity with it. To handle data races, we use synchronization primitives such as a mutex. A mutex is a way to lock the data used by one thread to avoid invalid behavior produced by simultaneously accessing the same data from several threads.
We also covered the idea that an input/output operation is considered blocking and asynchronous functions are one of the ways to make it non-blocking. Coroutines as a part of the asynchronous execution of code were introduced in C++20.
We learned how to create and start a thread. More importantly, we learned how to manage data between...