Boost C++ 库

……是世界上最受尊敬、设计最精良的 C++ 库项目之一。 Herb SutterAndrei AlexandrescuC++ 编码标准

符合性与扩展 - Boost C++ 函数库
PrevUpHomeNext

]

表 37.2. C++11 标准符合性

章节

描述

状态

注释

Ticket

30

线程支持库

-

-

30.1

通用

-

-

-

30.2

要求

-

-

-

30.2.1

模板参数名称

-

-

-

30.2.2

异常

-

-

30.2.3

原生句柄

-

-

30.2.4

计时规范

-

-

30.2.5

Lockable 类型要求

-

-

30.2.5.1

总的来说

-

-

-

30.2.5.2

BasicLockable 要求

-

-

30.2.5.3

Lockable 要求

-

-

30.2.5.4

TimedLockable 要求

-

-

30.2.6

decay_copy

-

-

-

30.3

线程

-

-

30.3.1

线程类

-

-

30.3.1.1

线程::id 类

-

-

30.3.1.2

线程构造函数

部分

-

-

30.3.1.3

线程析构函数

-

-

30.3.1.4

线程赋值

-

-

30.3.1.5

线程成员

-

-

30.3.1.6

线程静态成员

-

-

30.3.1.7

线程专用算法

-

-

30.3.2

this_thread 命名空间

-

-

30.4

互斥

部分

-

-

30.4.1

互斥量要求

-

-

30.4.1.1

总的来说

-

-

30.4.1.2

互斥量类型

-

-

30.4.1.2.1

mutex 类

-

-

30.4.1.2.2

recursive_mutex 类

-

-

30.4.1.3

定时互斥量类型

-

-

30.4.1.3.1

timed_mutex 类

-

-

30.4.1.3.1

recursive_timed_mutex 类

-

-

30.4.2

-

-

30.4.2.1

lock_guard 类模板

-

-

30.4.2.2

unique_lock 类模板

-

-

30.4.2.2.1

unique_lock 构造函数、析构函数和赋值

-

-

30.4.2.2.2

unique_lock 加锁

-

-

30.4.2.2.3

unique_lock 修改器

-

-

30.4.2.2.4

unique_lock 观察者

-

-

30.4.3

通用加锁算法

部分

variadic

#6227

30.4.4

Call once

-

-

30.4.4.1

once_flag 结构

-

-

30.4.4.2

call_once 函数

-

-

30.5

条件变量

-

-

30.5.1

condition_variable 类

-

-

30.5.2

condition_variable_any 类

-

-

30.6

期物

-

-

30.6.1

概述

部分

-

-

30.6.2

错误处理

-

-

30.6.3

future_error 类

-

-

-

30.6.4

共享状态

-

-

-

30.6.5

promise 类模板

-

-

30.6.6

future 类模板

-

-

30.6.7

shared_future 类模板

-

-

30.6.8

async 函数模板

-

-

30.6.9

packaged_task 类模板

-

-


表 37.3. 扩展

章节

描述

注释

30.3.1.5.x

interrupt

-

30.3.2.x

中断

-

30.3.2.y

at_thread_exit

-

30.4.3.x

通用加锁算法 begin/end

-


表 37.4. [@https://isocpp.org.cn/files/papers/N3659.html N3659 C++ 并发共享锁修订版 2] 符合性

章节

描述

状态

注释

30.4.1.4

共享 Lockable 类型

-

30.4.1.4.1

shared_mutex 类

-

30.4.2.3

shared_lock 类模板

-


表 37.5. std::future<T> 及相关 API 的改进]

章节

描述

状态

注释

2.1

-

-

-

2.2

future 类模板

部分

-

2.2

部分

无隐式解包 #10550 和阻塞 #10551

2.2

is_ready

-

2.3

shared_future 类模板

部分

-

2.3

部分

无隐式解包 #10550 和阻塞 #10551

2.3

is_ready

-

2.4

when_all 函数模板

部分

接口不完整 #10426 和阻塞 #10551

2.5

when_any 函数模板

部分

接口不完整 #10427 和阻塞 #10551

2.6

when_any_back 函数模板

#XXXX

2.7

make_ready_future 函数模板

-


表 37.6. C++ Latches and Barriers 符合性

章节

描述

状态

注释

X.1

latch 类

部分

添加了一个新的 latch 类。其接口是提案接口的超集,并包含 barrier 类的一些函数。

X.2

barrier 类

即使 Boost.Thread 有一个 boost:barrier 类,它也不提供相同类型的服务。有一个实验性的 completion_latch 可用作替代。


表 37.7. C++ 并发队列符合性

章节

描述

状态

注释

X.1

概念接口

部分

提供的接口与该提案存在一些差异。所有带有 queue_op_status 的函数均未提供。没有无锁的具体类。

X.1.1

基本操作

部分

-

X.1.1.1

push

重命名为 push_back。

X.1.1.2

value_pop

重命名为 pull_front,有两个版本。

X.1.2

非等待操作

-

-

X.1.2.1

try_push

重命名为 try_push_back

X.1.2.2

try_pop

重命名为 try_pull_back

X.1.3

非阻塞操作

-

-

X.1.3.1

nonblocking_push

重命名为 nonblocking_push_back

X.1.3.2

nonblocking_pop

重命名为 nonblocking_pull_front

X.1.4

Push-front 操作

-

X.1.5

Closed queues (关闭队列)

部分

-

X.1.5.1

close

-

X.1.5.2

is_closed

重命名为 closed

X.1.5.3

wait_push

重命名为 wait_push_back

X.1.5.4

wait_pop

重命名为 wait_pull_front

X.1.5.5

wait_push_front

-

X.1.5.6

wait_pop_back

-

X.1.5.6

open

-

X.1.6

Empty and Full Queues (空队列和满队列)

-

X.1.6.1

is_empty

-

X.1.6.2

is_full

添加了容量

X.1.7

Queue Names (队列名称)

目前不认为是必须的。

X.1.8

Element Type Requirements (元素类型要求)

是?

-

X.1.9

异常处理

是?

-

X.1.10

Queue Ordering (队列排序)

是?

-

X.1.11

Lock-Free Implementations (无锁实现)

等待锁定接口稳定。一旦 Boost.Move 可感知,将使用 Boost.LockFree。

X.2

Concrete queues (具体队列)

部分

-

X.2.1

Locking Buffer Queue (锁定缓冲队列)

部分

classes sync_queue 和 sync_bounded_queue。

X.2.1

Lock-Free Buffer Queue (无锁缓冲队列)

等待锁定接口稳定。一旦 Boost.Move 可感知,将使用 Boost.LockFree。

X.3

Additional Conceptual Tools (附加概念工具)

-

X.3.1

Fronts and Backs (前端和后端)

-

X.3.2

Streaming Iterators (流式迭代器)

-

X.3.3

Storage Iterators (存储迭代器)

-

X.3.4

Binary Interfaces (二进制接口)

-

X.3.4

Managed Indirection (托管间接)

-


表 37.8. Executors and Schedulers (执行器和调度器)

章节

描述

状态

注释

V.1.1

executor 类

-

V.1.1

add

重命名为 submit 函数模板

V.1.1

num_of_pendin_closures (待处理闭包的数量)

V.1.2

sceduled_executor 类

-

V.1.2

add_at

重命名为 scheduler::submit_at 函数模板

V.1.2

add_after

重命名为 scheduler::submit_after 函数模板

V.2

Concrete executor classes (具体执行器类)

-

V.2.1

thread_pool

静态版本 basic_thread_pool,动态版本 execduler_adaptor<basic_thread_pool>

V.2.2

serial_executor

-

V.2.3

loop_executor

静态版本 loop_scheduler,动态版本 execduler_adaptor<loop_scheduler>

V.2.4

inline_executor

静态版本 inline_executor,动态版本 execduler_adaptor<inline_executor>

V.2.5

thread_executor

静态版本 thread_executor,动态版本 execduler_adaptor<thread_executor>


表 37.9. `async, future/shared_future::then` 和 Executors (执行器)

章节

描述

状态

注释

30.6.6

future<T>::then

30.6.7

shared_future<T>::then

30.6.8

async

-


表 37.10. Executors and Schedulers - revision 4 (执行器和调度器 - 修订版 4)

章节

描述

状态

注释

VI.A

Executor Concept (执行器概念)

`wrapper_type` 重命名为 `work`,`spawn` 重命名为 `submit`]] [[VI.A.1] thread_per_task_executor

重命名为 `thread_executor`

VI.A.2

thread_pool_executor

重命名为 `basic_thread_pool`

VI.A.3

system_executor

-

VI.A.4

loop_executor

-

VI.A.5

serial_executor

-

VI.B

executor_ref

-

VI.C

executor

重命名为 `gen_executor_ref`

VI.D

Free Functions and Helper Objects (自由函数和辅助对象)

partial (部分)

-

VI.D

make_package

-

VI.D

spawn_future

`async(Ex&, ...)` 类似,但返回一个阻塞的 future。

VI.D

spawn

-

VI.D

task_wrapper

重命名为 `resubmitter`

VI.D

set_executor

重命名为 `resubmit`

VI.D

function_wrapper

部分

重命名为 `work`



PrevUpHomeNext