Managing jobs with ThreadPool

I just used ThreadPool for the first time and found myself missing some functionality. For example, bool allJobsCompleted(), a stable (not ‘very volatile’) getJob() and a ThreadPoolJob* addJob(job), so one can keep track of the job once added.

Are other people having good experiences with this class? I have the feeling it’s another that has the potential to be really convenient if it had a little more attention.

3 Likes

I’m also missing an allJobsComplete function. Currently we use a while loop with number of jobs, then sleep for a few ms, etc. but it would be better to have an official function.

Had some trouble passing a lambda that returned a ThreadPoolJob::JobStatus as well but that was probably my fault. And returning void, it seemed like ThreadPool couldn’t tell the lambda had finished.