Multithreading and Concurrency
The Qt API builds on C++ to provide powerful functionality for parallel programming. Qt's cross-platform multi-threading functionality simplifies parallel programming, while added concurrency features make it easier to take advantage of multi-core architecture.
Cross-Platform Multi-Threading Made Simple
The straightforward mechanisms for threaded programming in Qt have been tested and improved in real-world applications for over 6 years. Thread support was introduced in Qt 2.2 in 2000, and the majority of Qt customers already use Qt threading classes to build high-performance, cross-platform multi-threaded applications.
Qt provides the following features to enable the development of threaded applications:
- Thread Management: Classes for creating, synchronizing
and terminating threads.
- Data Management: Qt provides data types that can be used for low-overhead thread sharing, and mutexes to protect data that needs to be modified by multiple threads are also provided.
- Object Management:
Qt also provides the possibility of starting separate per-thread event
loops. This allows event driven objects, such as timers and sockets,
to be used in any thread.
- Inter-Thread Communication: Straightforward facilities for communicating between threads, using the Qt Signals and Slots mechanism.
Get more technical details on Qt's multi-threading support
Even Easier Parallel Programming with Qt Concurrent
The QtConcurrent framework provides high-level APIs that make it possible to write multi-threaded programs without using low-level threading primitives. Building on Qt's threading features, QtConcurrent makes it easier to write certain kinds of multi-threaded application by integrating implementations of the well-known map-reduce and filter-reduce algorithms with Qt's container classes and object model.
Get more technical details on Qt Concurrent