Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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

by tye (Sage)
on May 16, 2006 at 15:13 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://549792]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-20 03:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found