D
David Karr
I have a loop nested inside another loop. Each iteration of the inner loopis independent, so I could conceivably create a thread for each iteration.However, I would think that would create too many threads (couple hundred) and probably make my box thrash before it dies.
Is there a practical way to make it queue N loop iterations and then block on the N+1st until a slot is available? If I was doing this in Java I would use a ThreadPoolExecutor, but I'm not aware of a similar mechanism in Perl (not already written as a reusable library, that is).
Is there a practical way to make it queue N loop iterations and then block on the N+1st until a slot is available? If I was doing this in Java I would use a ThreadPoolExecutor, but I'm not aware of a similar mechanism in Perl (not already written as a reusable library, that is).