go ahead... be a heretic | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Each fork() duplicates the code that is running. All the variables are duplicated and they are each in a separate process - and most importantly they don't communicate with each other (except for the wait() call). They don't update each other's variables. Each child is acting like like a parent when it starts the next iteration of the loop. The program you started is managing it's kids properly (limiting kids to 5). However, each child is also acting as a parent and managing kids. Their kids too. And so on. You start with one process, that makes two, then four, then eight, etc. This probably isn't what you intended ... you may want to check out a package by the name of Parallel::ForkManager. Find some sample code using that and you might find the light bulb. In reply to Re: Help with Fork bomb
by cursion
|
|