Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: How to run the child process parellel to the parent process with fork

by hdb (Parson)
on Mar 15, 2013 at 11:33 UTC ( #1023669=note: print w/ replies, xml ) Need Help??


in reply to How to run the child process parellel to the parent process with fork

From your example, you will not know the order of the processes. If you replace (1..3) with (1..1000), ie make the parent run longer, you will find that the printout from the child is somewhere in the middle. From which I conclude that the processes run in parallel.

At least this is what happens on my Windows machine with ActivePerl.

You might also want to switch on autoflush to make sure the output from print reaches the screen when it is executed: $|=1;


Comment on Re: How to run the child process parellel to the parent process with fork
Re^2: How to run the child process parellel to the parent process with fork
by srlbharu (Acolyte) on Mar 15, 2013 at 12:46 UTC

    Sorry for my wrong assumtion. It is proven both processes will be running simultanously. Thanks to all

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1023669]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2014-08-23 18:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (178 votes), past polls