QtConcurrent takes a thread from a thread pool. The size of the pool is equal to the number of cores/cpus in your machine. Thus if you run your three-thread code on a less-than-three-core machine (once you correct all the issues mentioned later), it will never complete. The other issue is that you are using signals and slots and incorrectly assuming the slots will be run in the context of threads running the function that emitted the signal. Moreover you assume your timers will fire in the context of the threads running the start() function -- they will not since you don't have an event loop running for each of those threads and timers need events to be handled. Thus your code will do practically nothing apart starting three timers returning immediately (effectively finishing those threads).
Bookmarks