I wanted to know will pthread_detach halt the parent until the child thread terminates, or it goes on with the execution??… As, the pthread_join waits for the child thread to finish and then proceed…
I wanted to know will pthread_detach halt the parent until the child thread terminates,
Share
I believe the purpose of pthread_detach is to indicate that you do not intend to call pthread_join on the given thread. It does not block. You would do this because the pthread implementation needs to keep track of the fact that the thread has terminated and what it’s exit value is in case of a later pthread_join. So you should either call pthread_join to free that space in the internal data structure, or call pthread_detach to indicate that the space should not be reserved.