tags:

views:

186

answers:

3

Is there some way to use thread pool with Qt 4.3? I know it has now been implemented in Qt 4.5. But is it somehow available in Qt 4.3 also?

A: 

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.

Pablo Santa Cruz
I already have a thread pool implemented in my code. I wanted to know,if Qt has something for it.
Ajay
+2  A: 

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

Jurily
+2  A: 

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.

TimW