Prior to C++11, threads were completely out of the scope of C++ as a language. Developers could use platform-specific libraries, such as pthreads or the Win32 application programming interface (API). Since each library has its own behavior, porting applications to another platform required significant development and testing efforts.
C++11 introduced threads as part of the C++ standard and defined a set of classes to create multithreaded applications in its standard library.
In this recipe, we will learn how to use C++ to spawn multiple concurrent threads in a single application.