Qt 提供线程支持按平台无关形式 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.
This document is intended for an audience that has knowledge of, and experience with, multithreaded applications. If you are new to threading see our Recommended Reading list:
这些类有关线程化应用程序。
|
The <QtConcurrentRun> header provides a way to run a function in a separate thread. |
|
|
The <QtConcurrentFilter> header provides concurrent Filter and Filter-Reduce. |
|
|
The <QtConcurrentMap> header provides concurrent Map and MapReduce. |
|
|
于整数上独立于平台的原子操作 |
|
|
Template class that provides platform-independent atomic operations on pointers |
|
|
表示异步计算的结果 |
|
|
简化 QFuture 同步的方便类 |
|
|
允许监视 QFuture 使用信号和插槽 |
|
|
在线程之间串行化访问 |
|
|
Convenience class that simplifies locking and unlocking mutexes |
|
|
Convenience class that simplifies locking and unlocking read-write locks for read access |
|
|
读写锁 |
|
|
用于所有可运行对象的基类 |
|
|
通用计数信号量 |
|
|
独立于平台的线程管理办法 |
|
|
管理 QThread 的集合 |
|
|
每线程数据存储 |
|
|
用于同步线程的条件变量 |
|
|
Convenience class that simplifies locking and unlocking read-write locks for write access |
|
|
High-level APIs that make it possible to write multi-threaded programs without using low-level threading primitives |
注意: 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.