I'm trying to write something that lets me:
* Create a pool of n threads
* Add m number of tasks (functions to execute)
* Start all threads and process tasks
* Enter an eventloop
* When all tasks are done, exit the eventloop
It works as long as number of tasks (num_tasks) is less than or equal to number number of threads (PARALLEL_PROCESSES) but hangs my program what it is greater, which I fail to understand why. Any ideas?
The reason to why I want to enter an eventloop while waiting for threads to finish as opposed to just joining the threads is because I also want to use a QTimer that checks the progress every x seconds and joining is blocking and wouldn't allow that.