To elaborate more. New process image will not have the existing threads and user defined data declared in current process will be wiped out. Parent can do is to wait for the child status by calling wait(). for example main() { pid = fork(); if (child) { exec("ls"); /// here 'ls' will replace the child process no matter how many threads it has } else // parent wait for child
} - Azhar. On Thu, Aug 4, 2011 at 9:50 PM, Azhar Hussain <azhar...@gmail.com> wrote: > The *exec* family of functions shall replace the current process image > with a new process image. It does not matter how many threads you have > whole process gets replaced with new one. > > > - > Azhar. > > > On Thu, Aug 4, 2011 at 8:27 PM, ankit sambyal <ankitsamb...@gmail.com>wrote: > >> What happens when a thread calls exec ?? What happens to the other threads >> of the same process ?? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.