Hi,

I'm developing an application that have many threads. These threads were started and then it waits until all threads have finished the work.
I start all the threads using a loop and I have calculated that the time spent to start these threads is high. High means more ore less 25ms to start 18 threads. It seems not to much but this is my bootleneck.

My Idea is to use a QWaitCondition on every thread. Start the threads. As they do not have data to process will go to sleep waiting a signal to the wait condition.
When I need them to process I can cal "wakeOne" to let the thread go up an process. After it finish the process it will go to sleep again.

Could this work?

And, if this works, how can I wait that all threads have finished the work?

Note: There is a worker thread(do not have an event loop) that start all the other threads.

Thanks,