in reply to Help with Fork bomb
On the first iteration of the foreach loop in sub fork (very unfortunate name, BTW!), built-in fork creates a child process which inherits the entire code, including the foreach loop.
On the parent’s second iteration, it creates another child. Meanwhile, on the child’s first iteration, it also creates another child.
On the next iteration, the parent and each existing child create more children. No wonder the code “explodes in a cloud of children.”
You need to re-think the logic of this code!
Athanasius <°(((>< contra mundum
|
|---|