a better design / approach would be
( which sometimes may not be the case you are looking for )
have a controller script and it should decide the number of threads to spawn based on throttling, current load, load database that it could with stand and several other factors
also this controller script should receive success / failure message from the instance which it is spawning so that decisions could be taken based on the decision
controller script should be able to collate the results; fluctuate the number of instances running at any point of time..
this might be too much for your requirement, but if you see a pattern of running such tasks in parallel most of the time, this should be a good to go way