视频教程     下载中心     Wiki     联络 登录   注册

Log
  1. 首页
  2. Qt 5.12.9
  3. Qt 中的线程支持

Qt 中的多线程技术

内容

  • 话题:
  • 线程类

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.

话题:

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

  • 线程类
  • Qt 中的多线程技术
  • 同步线程
  • 重入和线程安全
  • 线程和 QObject
  • Qt 模块中的线程支持

线程类

这些类有关线程化应用程序。

并发过滤和过滤减少

并发映射和映射减少

并发运行

QAtomicInteger

于整数上独立于平台的原子操作

QAtomicPointer

为指针提供独立于平台的原子操作的模板类

QFuture

表示异步计算的结果

QFutureSynchronizer

简化 QFuture 同步的方便类

QFutureWatcher

允许监视 QFuture 使用信号和插槽

QMutex

在线程之间串行化访问

QMutexLocker

简化锁定和解锁互斥的方便类

QReadLocker

用于读取访问的锁定和解锁的读写锁的方便简化类

QReadWriteLock

读写锁

QRunnable

用于所有可运行对象的基类

QSemaphore

通用计数信号量

QSemaphoreReleaser

异常安全的 QSemaphore::release() 调用的延迟

QThread

独立于平台的线程管理办法

QThreadPool

管理 QThread 的集合

QThreadStorage

每线程数据存储

QWaitCondition

用于同步线程的条件变量

QWriteLocker

用于写入访问的锁定和解锁的读写锁的方便简化类

QtConcurrent

使之无需使用低级线程原语就能编写多线程程序的高级 API

注意: 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.

Qt 中的多线程技术

版权所有  © 2014-2021 乐数软件    

工业和信息化部 : 粤ICP备14079481号-1