C + + Multithreading Get started thread introduction: https://www.cnblogs.com/vsuu/p/4170325.html
Join () && detach () && joinable ()
When the Thread::join () function is called, the thread that invokes it is blocked until the thread's execution is completed. Basically, this is a mechanism that you can use to know that a thread has ended. When Thread::join () returns, the executing thread of the OS has completed and the C + + thread object can be destroyed.
When thread::d the Etach () function is called, the executing thread is detached from the thread object and is no longer represented by a thread object-this is two separate things. The C + + thread object can be destroyed while the OS execution thread can continue
The member function joinable is used to detect if a thread requires a join. There are 3 joinable for false: 1.thread calls over detach; 2.thread has already been join; 3.thread is empty.
C + + Multithreading