Separate topics

When we do dedicated threads basically. and judge the main exits ... do separate streams continue or do they also come out in the same way as our regular continuous streams?

+3
source share
2 answers

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.

+4
source

If it is a different thread, then the main one, the rest of the threads will continue. But the C99 standard says:

- , int, ...

( int main, , POSIX.)

POSIX exit

...

, main , .

+1

Source: https://habr.com/ru/post/1759736/


All Articles