June 2018
Intermediate to advanced
348 pages
8h 45m
English
In the previous example, we saw that the initialization function is passed as an argument to the std::thread constructor, and the thread gets launched. This function runs on its own thread. The thread launch happens during the thread object's construction, but the initialization functions can have other alternatives as well. A function object is another possible argument in a thread class. The C++ standard library ensures that the std::thread works with any callable type.
The modern C++ standard supports threads to be initialized through:
Any callable entity is a candidate for initializing a thread. This enables the std::thread ...
Read now
Unlock full access