std:thread is introduced in C++11.
We can start creating threads by including the thread header file. To create a thread, we need to pass the code that needs to be executed in the constructor of the thread.
As soon as the thread object is created, a new thread is launched, which will execute the code passed to the constructor.
The constructor takes
- a function object
- a function pointer
- a lambda expression
No comments:
Post a Comment