MwnN
2007-10-17 15:44:20 UTC
Hi,
I'm trying to setup my app to use threads, a max of 10, but the app could
try to start more then 10 depending on the items selected to process.
If I have 23 items to process I would like to limit my app to use a max of
10 threads at any one time, so the other 10 will go into a thread queue and
only get started once a thread is finished.
I was thinking of using the OnTerminate() event in the thread to trigure the
next thread to start, keeping an array in the main thread with the on/off
setting for the threads, would this be an ok design or is there a prefeered
method for doing such a job.
Thanks,
MwnN
I'm trying to setup my app to use threads, a max of 10, but the app could
try to start more then 10 depending on the items selected to process.
If I have 23 items to process I would like to limit my app to use a max of
10 threads at any one time, so the other 10 will go into a thread queue and
only get started once a thread is finished.
I was thinking of using the OnTerminate() event in the thread to trigure the
next thread to start, keeping an array in the main thread with the on/off
setting for the threads, would this be an ok design or is there a prefeered
method for doing such a job.
Thanks,
MwnN