srlbharu has asked for the wisdom of the Perl Monks concerning the following question:
I have created the child process by using fork as shown because I need to run the child process and parent should not wait for child process's completion. It should be run as a independent process but spawned.
unless(fork){ print "Child Process created\n"; exit 0; } foreach $i (1..3) { print "Parent Process Created\n"; }
I need to run the child process parallel to the parent. but from the code shown parent is executed first and then child. Please let me know what am i doing wrong and If this is not the proper way to run the child process parallel to parent.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How to run the child process parellel to the parent process with fork
by hdb (Monsignor) on Mar 15, 2013 at 11:33 UTC | |
by srlbharu (Acolyte) on Mar 15, 2013 at 12:46 UTC | |
Re: How to run the child process parellel to the parent process with fork
by bart (Canon) on Mar 15, 2013 at 12:01 UTC | |
Re: How to run the child process parellel to the parent process with fork
by nagalenoj (Friar) on Mar 15, 2013 at 11:37 UTC | |
Re: How to run the child process parellel to the parent process with fork
by bojinlund (Monsignor) on Mar 15, 2013 at 23:04 UTC |
Back to
Seekers of Perl Wisdom