Just a quick update to say that Qt Concurrent has been integrated into Qt/main and is now available in the snapshots. The documentation is available here, end there’s a couple of examples in the examples/qtconcurrent/ directory in the snapshot package. Enjoy!
QtConcurrent
From Trolltech Labs
| Qt Concurrent | |||
| |||
| Platforms: | Windows, Linux, Mac | ||
| Qt version: | 4.2 required, 4.3 recommended. | ||
| License: | GPL | ||
Qt Concurrent blogs | |||
Subversion:
| |||
[edit] Qt Concurrent
[edit]
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.
[edit]
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.
[edit] Latest 5 Qt Concurrent Blogs
MapReduce was originally developed by Google to simplify writing parallel algorithms for computer clusters. The basic idea is that you divide your algorithm into two parts: one part that can be run in parallel on individual pieces of the input data (’map’), and one sequential part that collects the map results and produces the final […]
QtConcurrent::run() runs a function in a worker thread. It returns a QFuture, which is then used to synchronize with the result:
QString foo();
QFuture<QString> f = QtConcurrent::run(foo);
…
QString string = f.result()
Calling f.result() will block the current thread until foo() has returned. The QFuture template argument must match the return type of foo().
If the function you want to run […]
As a part of Trolltech Labs, I’m adding the Qt Concurrent project. Qt Concurrent is a high-level threading framework for writing code that automatically scales on multi-core systems.
For example, to make thumbnails of a list of images you can do this:
QImage scaled(const QImage &image)
{
return image.scaled(QSize(100, 100));
}
…
const QList<QImage> images = …
const QList<QImage> […]
