Concurrency and Multithreading
Concurrent programming allows us to create more efficient programs. C++ didn’t have built-in support for concurrency or multithreading for a long time. Now, it has full support for concurrent programming, threads, thread synchronization objects, and other functionality that we will discuss in this chapter.
Before the language was updated for thread support, programmers had to use third-party libraries. One of the most popular multithreading solutions was Portable Operating System Interface (POSIX) threads. C++ introduced thread support with C++11. It makes the language even more robust and applicable to wider areas of software development. Understanding threads is somewhat crucial for C++ programmers as they tend to squeeze every bit of the program to make it run even faster. Threads introduce us to a completely different way of making programs faster by running functions concurrently. Learning about multithreading at a fundamental level is...