I have few doubhts related to threads. Can you please clarify.
1. Is it possible to call fork() inside a thread.
2. Is it possible for a thread to create another thread.
Thanks
Kumar
I have few doubhts related to threads. Can you please clarify.
1. Is it possible to call fork() inside a thread.
2. Is it possible for a thread to create another thread.
Thanks
Kumar
1. Yes, but you may have some issues with file descriptors and/or sockets that are in use in the forked copy. However, if you are going to exec another application after the fork, then fine.
2. Yes. After all, you can consider the main application as being a thread itself.
The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.
Join / Linux Training / Board