I recently discovered ATL's CThreadPool class and was very happy with this find. It's a neat little class that will take care of the syncronization semantics of having multiple worker threads to process some queue of taks to do. The tasks are fed to the CThreadPool object, by some extrnal process.
While being very neat an clean, there doesn't seem to be a way find out whether all tasks have catually been completed. What's the best way to do that?
For example, say I need to do 10 heavy computational tasks and then move on to do something else. I can't move on until I know the tasks have completed.
So I create a CThreadPool with 10 threads, put the tasks on the queue and off they go to the threads. How would I know when the tasks are completed?
Boaz