It completely depends on how the main thread comes out. If it exits with help exit()or returns from main(), then the whole process ends, and each thread ends.
However, if it uses pthread_exit()to complete, then the process continues to work.
source
share