Repository navigation
docs(vol5): 修正 fence 性能结论并附基准测试 - #281
Merged
Charliechen114514 merged 1 commit intoOct 7, 2026
Merged
Charliechen114514 merged 1 commit into
Charliechen114514 merged 1 commit into
Conversation
Member
|
111这个我明天看下,感谢大佬🐈 |
Member
|
ok的,非常感谢大佬的勘误❀! |
Charliechen114514
merged commit Oct 7, 2026
b1fcf16
into
Awesome-Embedded-Learning-Studio:main
9 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修复说明
卷五「fence 与编译器屏障」原文把 fence 的灵活性直接解释为性能优势,例如认为多个 relaxed 操作配合一次 fence「显然更高效」。实际机器指令和耗时取决于架构、编译器与访问模式,不能从内存序写法直接推出。
本 PR 改写邮箱扫描、批量发布和平台屏障部分的性能表述,补充 fence-fence 同步的适用条件及多个标志不构成原子快照的说明。新增可复现的双线程 benchmark,并报告本机一次运行的 7 次中位数:逐字段 release/acquire 为 124.8 ns/轮,fence + relaxed 为 117.4 ns/轮。该测量包含轮询、缓存通信与确认操作,单次结果有波动,不能证明 fence 稳定更快。
修复类型
影响范围
documents/vol5-concurrency/ch03-atomic-memory-model/03-fence-and-barrier.mdcode/volumn_codes/vol5/ch03-atomic-memory-model/中的 benchmark、CMake 目标和 README验证方式
pnpm build测试环境:WSL2、Intel Core i5-12400、Linux x86-64;生产者固定 CPU 0,消费者固定 CPU 2;GCC 16.2,
-O3 -march=native。每种写法执行 7 次,每次 200 万轮。