开发者

Thread pool in Qt 4.3

Is there some way to use thread pool with Qt 4.3? I know i开发者_如何学运维t has now been implemented in Qt 4.5. But is it somehow available in Qt 4.3 also?


Get the first version of QtConcurrent from the Qt Labs project. This version of QtConcurrent is compatible with Qt4.2 but 4.3 is recommended .

From Qt Labs ...
Qt Concurrent

Platforms: Windows, Linux, Mac Qt
version: 4.2 required, 4.3 recommended.

Qt Concurrent is a C++ template library for writing multi-threaded applications.
Qt Concurrent provides high-level APIs that makes it possible to write multi-threaded programs withouth using low-level threading primitives such as critcal sections, mutexes or wait conditions.
Programs written with Qt Concurrent automaticallly adjust the number of threads used according to the number of processor cores available. This means that applications written today will continue to scale when deployed on multi-core systems in the future.

The library includes functional programming style APIs for for parallel list prosessing, a MapReduce implementation for shared-memory (non-distributed) systems, and classes for managing asynchronous computations in GUI applications.

The code can be checked out with subversion: svn checkout svn://labs.trolltech.com/svn/threads/qtconcurrent qtconcurrent
If you don't have svn, you can download a package instead.


You could get the 4.5 source code and rip it out from there. If they use their own API, it should be easy.


You can always use straight pthreads API in C/C++ with QT and implement your own thread pool.

Although you are probably looking for a solution involving less amount of work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜