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.
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.