vivekarcot has asked for the wisdom of the Perl Monks concerning the following question:
I am running a program in which i am using 10 forks. The different processes starts and intend to go for 3-4 hours. But the main exits after some time without any error message. I ll paste the snippet of the code here.
for ( my $count = 1; $count <= 10; $count++) { my $pid; if ($pid=fork) { } else { exec(&sub1($count, $lines,\@cnArray)); exit; # Ends the child process. } } while (wait() != -1) { }
It exits in the wait i guess and do not traverse the code which is below. Please help.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Main program exits even before the child process completes on windows
by cdarke (Prior) on Sep 01, 2011 at 14:30 UTC | |
by vivekarcot (Initiate) on Sep 02, 2011 at 05:25 UTC | |
|
Re: Main program exits even before the child process completes on windows
by chrestomanci (Priest) on Sep 01, 2011 at 15:05 UTC | |
|
Re: Main program exits even before the child process completes on windows
by RichardK (Parson) on Sep 01, 2011 at 16:07 UTC |