std::thread::join()This function is not used to start a thread. On the contrary, it is used to block the current thread and wait for the corresponding thread to end. std::threadA new thread starts running when the object is constructed.
join() itself does not start a thread. Asynchronous access can also be done with async, paired with std::future. However, this does not necessarily guarantee that a new thread will be started - unless std::launch::async is mandatory. It can only guarantee execution during get or wait.
std::thread::join()
This function is not used to start a thread. On the contrary, it is used to block the current thread and wait for the corresponding thread to end.std::thread
A new thread starts running when the object is constructed.join()
itself does not start a thread.Asynchronous access can also be done with
async
, paired withstd::future
. However, this does not necessarily guarantee that a new thread will be started - unlessstd::launch::async
is mandatory. It can only guarantee execution during get or wait.