In C++ using pthreads, what happens to your other threads if one of your threads calls fork?
It appears that the threads do not follow. In my case, I am trying to create a daemon and I use fork() with the parent exiting to deamonize it. However, in a new path through the code, I create some threads before the fork and some after. Is there an easy way to change ownership of the threads over to the new forked process rather than moving all my thread creation after the fork?
Nothing. Only the thread calling fork() gets duplicate. The child process has to start any new threads. The parents threads are left alone.