To make this execute in parallel, you can fork, or you can thread. While threads are more lightweight than forking, they are not without their own overhead.
It is tempting sometimes to want to parallelize certain operations, but typically there are limited CPUs in the machine, limited disk controllers etc, that give you decidedly non-linear characteristics. Good candidates for parallelizing are computationally distinct processes, asynchronous processes and the like. Operations that use the same piece of memory, or the same disk head are less likely to benefit. Don't forget that threading and parallelization are largely (but not completely) an illusion the OS creates for you.
Nothing to do with your question per se, but the range
contains 101 elements, not 100 - a trap I keep falling into, and is something to look out for.0 .. 100
In reply to Re: Fork/Child Question
by pbeckingham
in thread Fork/Child Question
by EchoAngel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |