QThreadPool... How to do
-
Hi, everyone !
In my application, I use the global QThreadPool to run many tasks asynchronously and make use of the priority system. However, some of these tasks have to be executed sequentially and I don't know how to mix both (asynchronous and synchronous) on the global QThreadPool.
Is there a way to do so ?
-
QThreadPool wasn't designed to check task sequences, so you'll have to manage the sequence externally (e.g. emit a signal when each task finishes, to trigger the start of the next task).
You can have a look at how KDE's "ThreadWeaver":http://api.kde.org/4.0-api/kdelibs-apidocs/threadweaver/html/index.html (which is built on Qt) does it.