Make the thread_signal_deliverable comment match its acquire loads
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 新手友好度
- 80/100
- Issue 类型
- 文档
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- c
调研方向
阅读 src/runtime/thread.h 中 thread_signal_deliverable 上方的注释,然后阅读 src/runtime/thread.c 中使用 THREAD_FOR_EACH_ACTIVE_RELAXED 和 thread_blocked_load 的扫描。查看提交 7bfe357,了解为什么这些 acquire 加载是有意为之,并保留关于为什么陈旧读取是无害的解释。完成意味着头文件不再声称 relaxed 读取,并且如果你进行可选的重命名,该宏的每个 grep 命中都已更新,且代码树仍能构建。
由索引模型根据 Issue 内容生成。
描述
Problem
The comment above thread_signal_deliverable in src/runtime/thread.h says it "uses relaxed reads on per-thread blocked fields". The code does not: the scan in src/runtime/thread.c walks THREAD_FOR_EACH_ACTIVE_RELAXED, which loads active with memory_order_acquire, and reads each mask through thread_blocked_load, which also uses memory_order_acquire. A reader who trusts the header comment would assume weaker ordering than the code gives, and the macro name ..._RELAXED points the same wrong way.
Proposal
Drop the ordering claim from the header comment and describe it as the lock-free scan it is ("Lock-free scan of the per-thread blocked fields; ..."), keeping the existing text on why stale reads are benign. Optionally rename THREAD_FOR_EACH_ACTIVE_RELAXED to THREAD_FOR_EACH_ACTIVE_LOCKFREE, since "relaxed" there means "without thread_lock", not memory_order_relaxed. Comment-only, or a mechanical rename; no behavior change.
Alternatives
Change the loads to memory_order_relaxed to match the comment. Not proposed: the acquire loads came in with 7bfe357 ("Move shared state to C11 atomics"), and nothing here shows they are unneeded.
Origin
Found during review of #505, where cubic flagged the same wording on the new thread_signal_blocked_any comment and it was fixed there.
- 主要语言
- C
- 星标
- 282
- 派生
- 32
- 平均合并
- 1 天 12 小时
- 30 天内合并 PR
- 17
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
sysprog21/elfuse 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
bug
难度 4/5 1-2 天 新手友好度 52/100
维护者通常 1 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 72/100
维护者通常 1 天内回复
相似的 Issue
-
polish
难度 2/5 1-3 小时 新手友好度 82/100
ChupathingyCE/chupathingyce#1366 ·
维护者通常 1 天内回复
-
slice track:dev
难度 2/5 1-3 小时 新手友好度 64/100
Life-Framework/Life-Framework#1831 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 80/100
-
bug intrinsic low priority wrong result
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复