[翻译]QT中的线程支持

QT中的线程支持


    原英文页面:http://qt-project.org/doc/qt-4.8/threads.html

    QT提供的线程支持以平台无关的线程类、线程安全的post events方式,以及跨线程的信号-槽机制组成。这使得开发可移植的多线程QT应用以及多处理器资源的充分利用十分容易。多线程编程也是处理耗时操作而不冻结应用UI交互的良好规范。

Topics:主题

推荐阅读:

这篇文档是写给那些具有多线程编程基础且有实际经验的读者,如果你不太熟悉线程相关知识,可以参考我们的阅读目录:

线程相关类:

这些是与线程相关的类

Asynchronous Run

The <QtConcurrentRun> header provides a way to run a function in a separate thread.

这个头文件提供了一种在分离的线程中运行函数的方法

Concurrent Filter and Filter-Reduce

The <QtConcurrentFilter> header provides concurrent Filter and Filter-Reduce.

这个头文件提供了并发Filter和 Filter-Reduce.

Concurrent Map and Map-Reduce

The <QtConcurrentMap> header provides concurrent Map and MapReduce.

这个头文件提供了并发Map和MapReduce

QAtomicInt

Platform-independent atomic operations on integers

提供平台无关的对于整型的原子操作

QAtomicPointer

Template class that provides platform-independent atomic operations on pointers

模板类,提供平台无关的对于指针的原子操作

QFuture

Represents the result of an asynchronous computation

异步计算结果的表示

QFutureSynchronizer

Convenience class that simplifies QFuture synchronization

简化QFuture 的同步

QFutureWatcher

Allows monitoring a QFuture using signals and slots

使用信号和槽监控QFuture对象

QMutex

Access serialization between threads

(实现)线程间的序列化

QMutexLocker

Convenience class that simplifies locking and unlocking mutexes

方便的类,简化了上锁/解锁操作

QReadLocker

Convenience class that simplifies locking and unlocking read-write locks for read access

方便的类,简化了读权限的上锁/解锁操作

QReadWriteLock

Read-write locking

读写锁

QRunnable

The base class for all runnable objects

所有Runnable对象的基类

QSemaphore

General counting semaphore

通用信号量计数器

QThread

Platform-independent way to manage threads

(提供)平台无关的方法管理线程

QThreadPool

Manages a collection of QThreads

(线程池)管理QTheads的集合

QThreadStorage

Per-thread data storage

每个线程的数据存储

QWaitCondition

Condition variable for synchronizing threads

同步线程用的条件变量

QWriteLocker

Convenience class that simplifies locking and unlocking read-write locks for write access

方便的类,简化了用于写权限的上锁/解锁操作

QtConcurrent

High-level APIs that make it possible to write multi-threaded programs without using low-level threading primitives

高级API,便于实现多线程程序而告别底层线程原语

注意:QT中的线程类以本地线程API实现。例如:Win32和pthreads,因此,这些线程类可以和本地API协同工作。






评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值