CodePudding user response:
All threads started first, and then we will go to joinOr create a semaphore group, wait for all semaphore
CodePudding user response:
Create a thread, the execution of the STD: : thread th (function), thread th began to start,Th. In the main thread calls the join (), as the main thread to block, waiting for the child thread th execution after return, continue, until the end of the main thread,
Th. In the main thread calls detach (), when the child thread th separated from the main thread, the main thread of their thread th control of the child thread th management control by the system background, and by its release thread related resources,