I have a C++ application that isn’t calling pthread_join and has O(time running) threads. My question is – how would this affect the health of the server task? Is there a fixed number of threads a C++ task can hold before it crashes or fails to start new threads? Will this manifest as an error code in pthread_create? Does it just leak memory or will it slow down processing time of the rest of the applications?
The threads are finishing (top level function is returning), just not being pthread_join‘ed.
The POSIX manual says
pthread_createcan returnEAGAIN:A simple fix would be to mark the threads detached using
pthread_detachor using an attribute andpthread_attr_setdetachstate. Then when they die they’re just collected.