Threads
To launch a thread in C++, you have to include the <thread>
header.
Thread Creation
A thread std::thread
represents an executable unit. This executable unit, which the thread immediately starts, gets its work package as a callable unit. A thread is not copy-constructible or copy-assignable but move-constructible or move-assignable.
A callable unit is an entity that behaves like a function. Of course, it can be a function but also a function object, or a lambda function. The return value of the callable unit is ignored.
After discussing theory, here is a small example.