Hi Richard,
am I wrong or does your solution fork a child per file found?
I wanted to give walto a snippet where I show how to spawn as many subprocesses as cores are available and the subprocesses working on a subqueue.
The verbose code tries to show that the subprocesses iterate over the initially created array in a way that they can "share" (*) this array without doing work twice. Have I overseen something?
UPDATE: It was an answer to the question "I can not find a simple way to split the loop into 2 (my no of cores) independent subprocesses...".
Best regards
McA
(*) It's a copy in the subprocess.
|