C++11 Thread support library 概览 线程库中英文对照(一)

2014-11-24 08:23:38 · 作者: · 浏览: 3
1 Threads线程
1.1 Functions managing the current thread管理当前线程函数
2 Mutual exclusion互斥量
2.1 Generic mutex management通用互斥管理
2.2 Generic locking algorithms通用锁算法
2.3 Call once单次调用
3 Condition variables条件变量
4 Futures未来
Threads
Threads enable the program to execute across several processor cores.
//线程使程序可以跨多个核(心)运行。
Defined in header //定义在头文件
thread
(C++11)
manages a separate thread //管理一个独立线程
(class)
Functions managing the current thread//管理当前线程的函数
Defined in namespace this_thread //定义在名字空间域this_thread
yield
(C++11)
hints the implementation to reschedule execution of threads
(function)//提示实现重新安排线程的执行,即调用yield将降低优先级。
get_id
(C++11)
returns the thread id of the current thread
(function)//返回线程标识
sleep_for
(C++11)
stops the execution of the current thread for a specified time duration
(function)//持续停止当前线程一段时间
sleep_until
(C++11)
stops the execution of the current thread until a specified time point
(function)//停止当前线程直到某个时间点
Mutual exclusion//互斥量
Mutual exclusion algorithms restrict access to a shared resource so that only one thread can access it at a time. This allows to avoid data races and to implement synchronization between threads.//互斥量限制访问共享资源,使只有一个线程在某一时刻可访问该资源。这避免了资源竞争,实现了线程间同步。
Defined in header //定义在头文件
mutex
(C++11)
provides basic mutual exclusion facility
(class)//提供基本互斥量
timed_mutex
(C++11)
provides mutual exclusion facility which implements locking with a timeout
(class)//提供超时互斥量(超时解锁)
recursive_mutex
(C++11)
provides mutual exclusion facility which can be locked recursively by the same thread
(class)//提供能被同一线程递归上锁的互斥量
recursive_timed_mutex
(C++11)
provides mutual exclusion facility which can be locked recursively
by the same thread and implements locking with a timeout
(class)//提供能被同一线程递归上锁且有超时的互斥量。(超市解锁)
Generic mutex management//通用互斥量管理
lock_guard
(C++11)
implements strictly scope-based mutex ownership wrapper
(class template)//基于严格作用域互斥的封装(退出作用域时自动被unlock)
unique_lock
(C++11)
implements movable mutex ownership wrapper
(class template)//可移动的互斥封装(独占锁,可设超时)
defer_lock_t
try_to_lock_t
adopt_lock_t
tag type used to specify locking strategy
(class)//定义指定锁策略的类型
defer_lock
try_to_lock
adopt_lock
tag constants used to specify locking strategy
(constant)//指定锁定策略的常量
Generic locking algorithms//通用锁算法
try_lock
(C++11)
locks specified mutexes/locks, returns false if at least one is unavailable
(function template)//锁上指定的互斥/锁,如果都不能行则返回false
lock
(C++11)
locks specified mutexes/locks, blocks if at least one is unavailable
(function template)//锁上指定的互斥/锁,只要有一个不行就阻塞。
Call once //调用一次
once_flag
(C++11)
helper object to ensure that call_once invokes the function only once
(class)//帮助对象确保其调用函数只有一次
call_once
(C++11)
invokes a function only once even if called from multiple threads
(function template)//即使多线程调用也只调用一次函数
Condition variables//条件变量
A condition variable is a synchronization primitive which implements a list of threads that are waiting until another thread notifies one or all of the waiting threads that the