Qt 5.11 | Thread Support in Qt

Qt 5.11.3 Reference Documentation

Multithreading Technologies in Qt

# Thread Support in Qt

Qt provides thread support in the form of platform-independent threading classes, a thread-safe way of posting events, and signal-slot connections across threads. This makes it easy to develop portable multithreaded Qt applications and take advantage of multiprocessor machines. Multithreaded programming is also a useful paradigm for performing time-consuming operations without freezing the user interface of an application.

Earlier versions of Qt offered an option to build the library without thread support. Since Qt 4.0, threads are always enabled.

## Topics:

These articles assume that the reader has basic knowledge about multithreaded applications.

- The Threading Classes
- Multithreading Technologies in Qt
- Synchronizing Threads
- Reentrancy and Thread-Safety
- Threads and QObjects
- Thread-Support in Qt Modules

## The Threading Classes

These classes are relevant to threaded applications.

Concurrent Filter and Filter-Reduce |
Concurrent Map and Map-Reduce |
Concurrent Run |
QAtomicPointer | Template class that provides platform-independent atomic operations on pointers
QFutureWatcher | Allows monitoring a QFuture using signals and slots
QSemaphoreReleaser | Exception-safe deferral of a QSemaphore::release() call
QThreadStorage | Per-thread data storage
QtConcurrent | High-level APIs that make it possible to write multi-threaded programs without using low-level threading primitives

Note: Qt's threading classes are implemented with native threading APIs; e.g., Win32 and pthreads. Therefore, they can be used with threads of the same native API.