C++ happens-before 关系是不可传递的
P0668R4 对此进行了解释
The definition of plain happens-before became unpleasantly complicated with the introduction of
memory_order_consume
. And it is not transitive, which remains counterintuitive. This proposal changes neither of those. And if the user refrains from usingmemory_order_consume
it can continue to be entirely ignored, as before. Until we have a usable version ofmemory_order_consume
, I would expect teaching materials to ignore these issues, and pretend that happens-befors is defined as our simply-happens-before relation, which is clearly transitive. In the presence ofmemory_order_consume
, this problem is unavoidable, since consume can order two accesses without also ordering the first with respect to an access that immediately follows the second; happens-before cannot compose with sequenced-before, and thus happens-before cannot be transitive.
在不使用 memory_order_consume
的情况下,happens-before 可以视为可传递,否则为不可传递。C++17 提出了 strongly happens before
,排除了 memory_order_consume
,是可传递的,可以和 sequenced-before 进行组合。
最新文章
- Java截图笔记
- .Net的基础概念
- PHP 安全检测代码片段
- (转载)四种常见的 POST 提交数据方式
- CSS Sprites的详细使用步骤
- D - Specialized Four-Digit Numbers
- SD卡在单片机上的应用
- Nhibernate初入门基本配置(一)
- 【HTTP 2】 序言
- usb调试
- 芯片SIAT-002测试PCB板设计
- Linux学习之路4——文件IO打开、创建、读写操作
- winform界面特效470多例
- iperf3 不支持双工模式
- ESP-EYE V2.1 开发板 WINDOWS 10 开发入门
- 高可用Hadoop平台-Hue In Hadoop
- 10.24CRM完成
- C166-变量和函数指定物理地址一
- 写了一个简单的Linux Shell用来下载文件
- 我的Quartz笔记
热门文章
- 实用QPS和TPS高的高效分析方法
- 【Vue.js】SPA
- buu misc 1-32 wp
- Timer定时器的使用
- C++ 编译错误记录
- 洛谷 P3676 - 小清新数据结构题(动态点分治)
- Codeforces 576D - Flights for Regular Customers(bitset 优化广义矩阵乘法)
- pycurl报错: ImportError: pycurl: libcurl link-time ssl backend (openssl) is different from compile-time ssl backend
- VSCode + PicGo + Github + jsDelivr 搭建稳定快速高效图床
- 【基因组注释】同源注释比对软件tblastn、gamp和exonerate比较