Till recently, I was under the impression that if you \"detach\" a thread after spawning it, the thread lives even after the \"main\" thread terminates.
But a litt
Yes, the detached threads will die after return 0.
From the NOTES section of man pthread_detach
The detached attribute merely determines the behavior of the system when the thread terminates; it does not prevent the thread from being terminated if the process terminates using exit(3) (or equiv‐alently, if the main thread returns)