Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: strange behaviour when forking lots of times (1<<$N)

by tye (Sage)
on May 16, 2006 at 15:13 UTC ( #549792=note: print w/replies, xml ) Need Help??


in reply to Re: strange behaviour when forking lots of times
in thread strange behaviour when forking lots of times

No, it forks about 2**11 processes. The first time through the loop, it forks once, creating two processes that each have 9 items left to do. The next time, the 2 processes become 4 that each have 8 items left to do. Then 4 become 8 that each have 7 items left to do... For a total of 2*(2**$N-1). And the whole run takes a fraction of second. (:

- tye        

  • Comment on Re^2: strange behaviour when forking lots of times (1<<$N)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2019-11-13 02:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (68 votes). Check out past polls.

    Notices?