主题索引
性能剖析与诊断工具
比较采样剖析、火焰图、执行追踪与调用栈诊断的使用方法和解读边界。
来源书籍
8/9
_workflow.md v8 升级记录。v10 续跑核验(2026-10-01):历史章节进度缺少
_coverage.md单元证据,按当前 coverage-template 将前言与 21 章恢复为pending。旧版 done 是历史结论;本次进度与来源版本以_coverage.md、_workflow.md为准。首次 Skill 版本 v4 保留不变。
本目录已按 book-notes v4 规则做强制重跑迁移:保留原有卡片取材,补齐证据链字段、统一章节进度字段,并按命中类别执行清单核对。
在 book-workflow S2 阶段,针对 _card_review.md 历史发现的问题逐张回读 _chapter-text/chNN.txt 原文,重建全部 71 张卡片的”位置/结论依据/原始内容”证据字段(原字段存在大面积源文件/章节错配,已整改);分类字段由旧枚举”专业/工作”迁移为当前模板分类(69 张改为”普通读书笔记卡”,ch01-001、ch15-003、ch16-003、ch16-004、ch17-001、ch20-001、ch20-003 因已含 Mermaid 结构图改为”结构图卡”);修正 ch01-004-SSA利于优化.md 表述使其准确区分编译器中间表示层规则与源码变量规则;为 ch10-003、ch15-004 及 ch18-001 至 ch20-005(第18-20章全部卡片)加注”(书中 Go 1.13⁄1.14)”版本标注;为 ch21-001、ch21-003 补充采样偏差与工具互相干扰的边界说明;新增结构图卡 ch15-006-GMP调度路径全景.md,关联 ch15-001 至 ch15-005。卡片总数由 71 张增至 72 张。
执行模式:light
建档进度:done
本次执行:book-notes v23(2026-10-23),light;本轮按“先解释概念、再讲关联”重写整书讲解,复用已核验的全文覆盖、182张知识卡与2项实践计划。首次Skill版本保留;未执行生成后的笔记复核、独立审查及审查结果优化。
| 章节号 | 章节标题 | 精读/略读 | 状态(pending/done) | 卡片数 |
|---|---|---|---|---|
| 前言 | 前言 | 精读 | done | 0 |
| 第1章 | 深入Go语言编译器 | 精读 | done | 16 |
| 第2章 | 浮点数设计原理与使用方法 | 精读 | done | 14 |
| 第3章 | 类型推断全解析 | 精读 | done | 2 |
| 第4章 | 常量与隐式类型转换 | 精读 | done | 5 |
| 第5章 | 字符串本质与实现 | 精读 | done | 5 |
| 第6章 | 数组 | 精读 | done | 3 |
| 第7章 | 切片使用方法与底层原理 | 精读 | done | 6 |
| 第8章 | 哈希表与Go语言实现机制 | 精读 | done | 7 |
| 第9章 | 函数与栈 | 精读 | done | 7 |
| 第10章 | defer延迟调用 | 精读 | done | 6 |
| 第11章 | 异常与异常捕获 | 精读 | done | 5 |
| 第12章 | 接口与程序设计模式 | 精读 | done | 13 |
| 第13章 | 反射高级编程 | 精读 | done | 10 |
| 第14章 | 协程初探 | 精读 | done | 8 |
| 第15章 | 深入协程设计与调度原理 | 精读 | done | 11 |
| 第16章 | 通道与协程间通信 | 精读 | done | 13 |
| 第17章 | 并发控制 | 精读 | done | 14 |
| 第18章 | 内存分配管理 | 精读 | done | 7 |
| 第19章 | 垃圾回收初探 | 精读 | done | 8 |
| 第20章 | 深入垃圾回收全流程 | 精读 | done | 11 |
| 第21章 | 调试利器:特征分析与事件追踪 | 精读 | done | 11 |
ch15-006-GMP调度路径全景.md)| 术语名 | 出现章节 | 一句话语境 |
|---|
| 标题 | 类型(书/论文/框架/源码项目) | 出现章节 | 一句话语境 |
|---|
| 序号 | 实践标题 | 实践方式 | 状态 | 关联章节 | 产出 |
|---|---|---|---|---|---|
| 1 | 核对接口逃逸 | 其他(最小实验) | done | 第1章、第12章 | 逃逸分析日志与基准测试数据对比计划 |
| 2 | 对照GOGC与GC频率 | 其他(最小实验) | done | 第20章 | 三组GOGC值对照表计划 |
实践候选筛选:done
复用两项受控最小实验计划。接口逃逸须运行编译诊断才能判断,GOGC频率须控制负载观察;其他调度、通道、分配器深读与两项目标重叠或范围较大,本次不新增。实践未执行。
| 维度 | 覆盖状态(已覆盖/补充生成/未覆盖) | 关联卡片标题或未覆盖理由 |
|---|---|---|
| 类型系统 | 已覆盖 | [[推断依赖上下文]]、[[无类型常量]]、[[接口存两类信息]]、[[反射分类型和值]];本书未讲泛型实现 |
| 内存管理模型 | 已覆盖 | [[逃逸分析原则]]、[[对象分级分配]]、[[标记清扫依可达性]]、[[混合写屏障]] |
| 并发/并行模型 | 已覆盖 | [[GMP分工]]、[[窃取平衡负载]]、[[抢占保证机会]]、[[Channel三部分]]、[[同步关系界定争用]] |
| 错误处理机制 | 已覆盖 | [[Panic沿栈展开]]、[[Recover有边界]];本书未系统比较 Result/Option |
| 编译/执行模型 | 已覆盖 | [[编译器三阶段]]、[[SSA利于优化]]、[[静态与动态链接交换体积和依赖]] |
| 模块/包与命名空间设计 | 未覆盖 | 本书重点在编译器与运行时底层,对包/模块命名空间没有系统展开。 |
| 语言设计哲学与取舍 | 已覆盖 | [[优化是折中]]、[[隐式实现降耦]]、[[反射换取动态性]]、[[小栈可增长]] |
| 元编程/反射/宏能力 | 已覆盖 | [[反射分类型和值]]、[[可设置性来自地址]]、[[动态调用更贵]];本书未展开宏机制 |
| 性能特性与其代价 | 已覆盖 | [[逃逸分析原则]]、[[Defer优化演进]]、[[三级缓存降锁]]、[[辅助标记背压]]、[[Pprof看样本]] |
v8 历史维护:复用 3 个已有主题(并发任务与同步原语、类型推导规则、用类型与框架保障代码正确性),新建 11 个 Go 运行时/语言机制主题。v7 S7 列出的 3 个待确认跨书候选(工作窃取、垃圾回收跨语言对比、锁竞争降锁设计)已按 v8 Markdown 主题流程分别并入 goroutine-scheduling、garbage-collection、memory-allocation。本轮 V10 新增卡片的主题结论见表末。
| 卡片标题 | 结论 | 主题文件或原因 |
|---|---|---|
| 编译器三阶段 | 已创建 | notes/_topics/compiler-optimization.md |
| 优化是折中 | 已创建 | notes/_topics/compiler-optimization.md |
| 逃逸分析原则 | 已创建 | notes/_topics/compiler-optimization.md |
| SSA利于优化 | 已创建 | notes/_topics/compiler-optimization.md |
| 逃逸图边权刻画指针流 | 已复用 | notes/_topics/compiler-optimization.md |
| 用GOSSAFUNC观察优化 | 已复用 | notes/_topics/compiler-optimization.md |
| 接口赋值与断言分两关 | 已复用 | notes/_topics/interface-design-dispatch.md |
| 浮点不是实数 | 已创建 | notes/_topics/numeric-precision.md |
| NaN破坏直觉 | 已创建 | notes/_topics/numeric-precision.md |
| 误差要建模 | 已创建 | notes/_topics/numeric-precision.md |
| 推断依赖上下文 | 已复用 | notes/_topics/type-deduction.md |
| 简洁有边界 | 已复用 | notes/_topics/type-deduction.md |
| 无类型常量 | 已复用 | notes/_topics/type-deduction.md |
| 隐式转换很窄 | 已复用 | notes/_topics/correct-by-construction.md |
| 字符串是只读字节 | 已创建 | notes/_topics/builtin-data-structure-internals.md |
| Rune承载字符 | 已创建 | notes/_topics/builtin-data-structure-internals.md |
| 转换可能复制 | 已创建 | notes/_topics/builtin-data-structure-internals.md |
| 数组是值 | 已创建 | notes/_topics/builtin-data-structure-internals.md |
| 越界可提前发现 | 已复用 | notes/_topics/correct-by-construction.md |
| 切片三元组 | 已创建 | notes/_topics/builtin-data-structure-internals.md |
| Append可能换底座 | 已创建 | notes/_topics/builtin-data-structure-internals.md |
| 截取保留引用 | 已创建 | notes/_topics/builtin-data-structure-internals.md |
| Map桶化存储 | 已创建 | notes/_topics/builtin-data-structure-internals.md |
| 键必须可比较 | 已创建 | notes/_topics/builtin-data-structure-internals.md |
| 渐进扩容 | 已创建 | notes/_topics/builtin-data-structure-internals.md |
| Map并发边界 | 已复用 | notes/_topics/concurrency-tasks-sync.md |
| 栈帧保存现场 | 已创建 | notes/_topics/function-call-stack.md |
| 小栈可增长 | 已创建 | notes/_topics/function-call-stack.md |
| 闭包捕获有成本 | 已创建 | notes/_topics/function-call-stack.md |
| 调用链可诊断 | 已创建 | notes/_topics/performance-profiling.md |
| Defer后进先出 | 已创建 | notes/_topics/error-handling-mechanisms.md |
| 返回值陷阱 | 已创建 | notes/_topics/error-handling-mechanisms.md |
| Defer优化演进 | 已创建 | notes/_topics/compiler-optimization.md |
| Panic沿栈展开 | 已创建 | notes/_topics/error-handling-mechanisms.md |
| Recover有边界 | 已创建 | notes/_topics/error-handling-mechanisms.md |
| 小接口更稳 | 已创建 | notes/_topics/interface-design-dispatch.md |
| 隐式实现降耦 | 已创建 | notes/_topics/interface-design-dispatch.md |
| 接口存两类信息 | 已创建 | notes/_topics/interface-design-dispatch.md |
| 接口会促逃逸 | 已创建 | notes/_topics/compiler-optimization.md |
| Nil接口陷阱 | 已创建 | notes/_topics/interface-design-dispatch.md |
| 反射换取动态性 | 已创建 | notes/_topics/reflection-runtime-dynamism.md |
| 可设置性来自地址 | 已创建 | notes/_topics/reflection-runtime-dynamism.md |
| 动态调用更贵 | 已创建 | notes/_topics/reflection-runtime-dynamism.md |
| 协程不是线程 | 已复用 | notes/_topics/concurrency-tasks-sync.md |
| 并发不是并行 | 已复用 | notes/_topics/concurrency-tasks-sync.md |
| GMP分工 | 已创建 | notes/_topics/goroutine-scheduling.md |
| G0负责调度 | 已创建 | notes/_topics/goroutine-scheduling.md |
| 队列兼顾公平 | 已创建 | notes/_topics/goroutine-scheduling.md |
| 窃取平衡负载 | 已创建 | notes/_topics/goroutine-scheduling.md |
| 抢占保证机会 | 已创建 | notes/_topics/goroutine-scheduling.md |
| 系统调用要交接 | 已创建 | notes/_topics/goroutine-scheduling.md |
| GMP调度路径全景 | 已创建 | notes/_topics/goroutine-scheduling.md |
| 通信表达所有权 | 已复用 | notes/_topics/concurrency-tasks-sync.md |
| Channel三部分 | 已复用 | notes/_topics/concurrency-tasks-sync.md |
| 阻塞会让出G | 已复用 | notes/_topics/concurrency-tasks-sync.md |
| Select处理多路等待 | 已复用 | notes/_topics/concurrency-tasks-sync.md |
| Context传递取消 | 已复用 | notes/_topics/concurrency-tasks-sync.md |
| 数据争用是错 | 已复用 | notes/_topics/concurrency-tasks-sync.md |
| 互斥锁保护不变量 | 已复用 | notes/_topics/concurrency-tasks-sync.md |
| 读写锁看比例 | 已复用 | notes/_topics/concurrency-tasks-sync.md |
| 对象分级分配 | 已创建 | notes/_topics/memory-allocation.md |
| Span管理同类块 | 已创建 | notes/_topics/memory-allocation.md |
| 三级缓存降锁 | 已创建 | notes/_topics/memory-allocation.md |
| GC降低心智负担 | 已创建 | notes/_topics/garbage-collection.md |
| Go不压缩对象 | 已创建 | notes/_topics/garbage-collection.md |
| 非分代也有理由 | 已创建 | notes/_topics/garbage-collection.md |
| GC循环分阶段 | 已创建 | notes/_topics/garbage-collection.md |
| 标记目标25% | 已创建 | notes/_topics/garbage-collection.md |
| 混合写屏障 | 已创建 | notes/_topics/garbage-collection.md |
| 辅助标记背压 | 已创建 | notes/_topics/garbage-collection.md |
| GOGC调步 | 已创建 | notes/_topics/garbage-collection.md |
| Pprof看样本 | 已创建 | notes/_topics/performance-profiling.md |
| 火焰图看宽度 | 已创建 | notes/_topics/performance-profiling.md |
| Trace看时间线 | 已创建 | notes/_topics/performance-profiling.md |
| 诊断要回到机制 | 已创建 | notes/_topics/performance-profiling.md |
| 词法解析将源码切成符号 | 已复用 | notes/_topics/compiler-optimization.md |
| 递归下降按语法解析声明 | 已复用 | notes/_topics/compiler-optimization.md |
| 抽象语法树保留程序语义 | 已复用 | notes/_topics/compiler-optimization.md |
| 类型检查补足节点类型 | 已复用 | notes/_topics/compiler-optimization.md |
| 内联减少调用成本但受预算约束 | 已复用 | notes/_topics/compiler-optimization.md |
| 闭包重写区分立即调用与延后调用 | 已复用 | notes/_topics/compiler-optimization.md |
| 遍历阶段降低高层操作 | 已复用 | notes/_topics/compiler-optimization.md |
| 汇编阶段生成目标文件 | 已复用 | notes/_topics/compiler-optimization.md |
| 静态与动态链接交换体积和依赖 | 已复用 | notes/_topics/compiler-optimization.md |
| ELF段描述内存装载方式 | 已复用 | notes/_topics/compiler-optimization.md |
| 定点与浮点交换范围和精度 | 已复用 | notes/_topics/numeric-precision.md |
| IEEE浮点拆为符号指数尾数 | 已复用 | notes/_topics/numeric-precision.md |
| 浮点整数判断需检查有效位 | 已复用 | notes/_topics/numeric-precision.md |
| 非常规数填补接近零的区间 | 已复用 | notes/_topics/numeric-precision.md |
| 十进制有效位取决于数值范围 | 已复用 | notes/_topics/numeric-precision.md |
| 打印十进制不改变浮点存值 | 已复用 | notes/_topics/numeric-precision.md |
| 大整数用多字存储扩展范围 | 已复用 | notes/_topics/numeric-precision.md |
| 大浮点增加精度仍需舍入 | 已复用 | notes/_topics/numeric-precision.md |
| 有理数用分数保留精确值 | 已复用 | notes/_topics/numeric-precision.md |
| 金额累计误差可越过判断边界 | 已复用 | notes/_topics/numeric-precision.md |
| 金额计算选十进制或分数表示 | 已复用 | notes/_topics/numeric-precision.md |
| 常量转换须可表示 | 已复用 | notes/_topics/correct-by-construction.md |
| 无类型常量按种类提升 | 已复用 | notes/_topics/type-deduction.md |
| 有类型常量保留自定义类型 | 已复用 | notes/_topics/type-deduction.md |
| 原始字符串与转义字符串 | 已复用 | notes/_topics/builtin-data-structure-internals.md |
| 字符串拼接创建新结果 | 已复用 | notes/_topics/builtin-data-structure-internals.md |
| 数组长度属于类型 | 已复用 | notes/_topics/builtin-data-structure-internals.md |
| 长度与容量约束切片 | 已复用 | notes/_topics/builtin-data-structure-internals.md |
| 追加结果必须接回 | 已复用 | notes/_topics/builtin-data-structure-internals.md |
| 复制切片需独立目的地 | 已复用 | notes/_topics/builtin-data-structure-internals.md |
| Nil映射可读不可写 | 已复用 | notes/_topics/builtin-data-structure-internals.md |
| 双返回值区分键缺失 | 已复用 | notes/_topics/builtin-data-structure-internals.md |
| 碰撞处理有两条路径 | 已复用 | notes/_topics/builtin-data-structure-internals.md |
| 函数可作为值传递 | 已复用 | notes/_topics/function-call-stack.md |
| 闭包绑定外部环境 | 已复用 | notes/_topics/function-call-stack.md |
| 循环闭包需辨版本 | 已复用 | notes/_topics/function-call-stack.md |
| 获取资源后立即登记清理 | 已复用 | notes/_topics/error-handling-mechanisms.md |
| Defer参数先求值 | 已复用 | notes/_topics/error-handling-mechanisms.md |
| 开放编码用位图跟踪Defer | 已复用 | notes/_topics/error-handling-mechanisms.md |
| 恢复后从保护函数返回 | 已复用 | notes/_topics/error-handling-mechanisms.md |
| 嵌套Panic只恢复最近层 | 已复用 | notes/_topics/error-handling-mechanisms.md |
| 开放Defer参与Panic | 已复用 | notes/_topics/error-handling-mechanisms.md |
| 接口隔离数据库替换 | 已复用 | notes/_topics/interface-design-dispatch.md |
| 断言失败要接收ok | 已复用 | notes/_topics/interface-design-dispatch.md |
| 空接口只保证可装载 | 已复用 | notes/_topics/interface-design-dispatch.md |
| 接口比较检查动态值 | 已复用 | notes/_topics/interface-design-dispatch.md |
| 指针方法限定实现者 | 已复用 | notes/_topics/interface-design-dispatch.md |
| 切片不能整体装箱 | 已复用 | notes/_topics/interface-design-dispatch.md |
| 接口调用经方法表 | 已复用 | notes/_topics/interface-design-dispatch.md |
| 反射分类型和值 | 已复用 | notes/_topics/reflection-runtime-dynamism.md |
| Kind是底层种类 | 已复用 | notes/_topics/reflection-runtime-dynamism.md |
| 反射值可还原接口 | 已复用 | notes/_topics/reflection-runtime-dynamism.md |
| 两种Elem各司其职 | 已复用 | notes/_topics/reflection-runtime-dynamism.md |
| 字段元数据与值分取 | 已复用 | notes/_topics/reflection-runtime-dynamism.md |
| 动态调用先验签名 | 已复用 | notes/_topics/reflection-runtime-dynamism.md |
| StructOf运行时组类型 | 已复用 | notes/_topics/reflection-runtime-dynamism.md |
| 进程隔离线程共享 | 已复用 | notes/_topics/goroutine-scheduling.md |
| 线程切换须保存现场 | 已复用 | notes/_topics/goroutine-scheduling.md |
| 协程可被运行时抢占 | 已复用 | notes/_topics/goroutine-scheduling.md |
| Go语句异步启动协程 | 已复用 | notes/_topics/goroutine-scheduling.md |
| 主函数退出不等协程 | 已复用 | notes/_topics/goroutine-scheduling.md |
| 协程状态区分等待与就绪 | 已复用 | notes/_topics/goroutine-scheduling.md |
| 线程本地存储绑定M | 已复用 | notes/_topics/goroutine-scheduling.md |
| 调度循环往返g0 | 已复用 | notes/_topics/goroutine-scheduling.md |
| 阻塞协程须被唤醒 | 已复用 | notes/_topics/goroutine-scheduling.md |
| 网络就绪重返调度 | 已复用 | notes/_topics/goroutine-scheduling.md |
| 无缓冲通道同步交接 | 已复用 | notes/_topics/concurrency-tasks-sync.md |
| Nil通道不会就绪 | 已复用 | notes/_topics/concurrency-tasks-sync.md |
| 单向通道收窄权限 | 已复用 | notes/_topics/concurrency-tasks-sync.md |
| 关闭后接收要看ok | 已复用 | notes/_topics/concurrency-tasks-sync.md |
| Range通道直到关闭 | 已复用 | notes/_topics/concurrency-tasks-sync.md |
| 用消息确认协程完成 | 已复用 | notes/_topics/concurrency-tasks-sync.md |
| Select默认分支不等待 | 已复用 | notes/_topics/concurrency-tasks-sync.md |
| Select等待须撤销旁支 | 已复用 | notes/_topics/concurrency-tasks-sync.md |
| 每轮超时不同于总限时 | 已复用 | notes/_topics/concurrency-tasks-sync.md |
| 取消信号须主动响应 | 已复用 | notes/_topics/concurrency-tasks-sync.md |
| 父截止时间约束子任务 | 已复用 | notes/_topics/concurrency-tasks-sync.md |
| Context值只放请求元数据 | 已复用 | notes/_topics/concurrency-tasks-sync.md |
| Race检查只覆盖运行路径 | 已复用 | notes/_topics/concurrency-tasks-sync.md |
| 同步关系界定争用 | 已复用 | notes/_topics/concurrency-tasks-sync.md |
| 原子更新不保护复合条件 | 已复用 | notes/_topics/concurrency-tasks-sync.md |
| 互斥锁兼顾自旋与休眠 | 已复用 | notes/_topics/concurrency-tasks-sync.md |
| 读写锁等待写者时阻新读 | 已复用 | notes/_topics/concurrency-tasks-sync.md |
| Context四方法分工 | 已复用 | notes/_topics/concurrency-tasks-sync.md |
| 矢量时钟判断先后 | 已复用 | notes/_topics/concurrency-tasks-sync.md |
| 微小对象共享槽位 | 已复用 | notes/_topics/memory-allocation.md |
| 位图定位空闲槽 | 已复用 | notes/_topics/memory-allocation.md |
| 清扫后再复用Span | 已复用 | notes/_topics/memory-allocation.md |
| 页摘要寻找连续空间 | 已复用 | notes/_topics/memory-allocation.md |
| 标记清扫依可达性 | 已复用 | notes/_topics/garbage-collection.md |
| 三色标记区分扫描状态 | 已复用 | notes/_topics/garbage-collection.md |
| 移动回收换取紧凑空间 | 已复用 | notes/_topics/garbage-collection.md |
| 引用计数难解环 | 已复用 | notes/_topics/garbage-collection.md |
| 并发标记缩短暂停 | 已复用 | notes/_topics/garbage-collection.md |
| 根扫描需编译器配合 | 已复用 | notes/_topics/garbage-collection.md |
| Finalizer不保资源释放 | 已复用 | notes/_topics/garbage-collection.md |
| 本地标记队列减锁 | 已复用 | notes/_topics/garbage-collection.md |
| 清扫复用不同于返还系统 | 已复用 | notes/_topics/garbage-collection.md |
| 按分配量推进清扫 | 已复用 | notes/_topics/garbage-collection.md |
| 分配热点驱动GC排查 | 已复用 | notes/_topics/performance-profiling.md |
| Flat与Cum分清自身和路径 | 已复用 | notes/_topics/performance-profiling.md |
| 堆画像分配与存活 | 已复用 | notes/_topics/performance-profiling.md |
| 协程快照结合前后对比 | 已复用 | notes/_topics/performance-profiling.md |
| 锁等待画像需启用采样 | 已复用 | notes/_topics/performance-profiling.md |
| Trace辨运行与等待 | 已复用 | notes/_topics/performance-profiling.md |
| 采样画像不等于事件流水 | 已复用 | notes/_topics/performance-profiling.md |
| 诊断端点限制访问 | 已复用 | notes/_topics/performance-profiling.md |
本轮 V10 新增 107 张知识卡均复用现有主题;没有提出新主题。旧版 72 张卡的历史结论保留。
阅读正文、全书主线、22个正文项讲解与跨章综合见 _book_note.md。
沿用 _coverage.md 的4项:平台页、版权页、空白页、仅概述范围的内容简介;前言纳入正文。
| 问题标题 | 问题卡 | 解决方案卡(如有) | 出现章节 | 一句话说明 |
|---|---|---|---|---|
| 金额累计误差 | [[金额累计误差可越过判断边界]] | [[金额计算选十进制或分数表示]] | 第2章 | 表示误差可跨过阈值;须明确表示和转换边界。 |
从本书的主题进入跨书阅读,对照其他书籍的讲解。下方数量包含主题关联的全部卡片与书籍。
主题索引
比较采样剖析、火焰图、执行追踪与调用栈诊断的使用方法和解读边界。
主题索引
线程的创建、状态、join/sleep/中断与收束,任务抽象为什么高于线程,线程池与 ForkJoin 的并行度与工作窃取,守护线程、ThreadLocal 与线程私有栈在什么条件下成立,以及并发结构怎样划分执行与状态;Actor/角色把状态隔离到单一线程、用 Inbox 串行收消息,是这条线的另一种解法。
主题索引
互斥锁与读写锁的适用比例、信号量与 CountDownLatch 的语义差别、条件等待为什么必须持锁并循环复查、锁顺序与可重入导致的死锁,以及粗粒度锁换简单性与细粒度锁换并发的代价。
主题索引
比较字符串、数组、切片、哈希表等内置结构的内存布局、扩容与复制代价。
主题索引
比较接口粒度、隐式/显式实现、接口值表示与动态分派的取舍。
主题索引
比较浮点、定点等数值表示的精度误差与特殊值陷阱。
主题索引
比较延迟执行、异常展开、恢复与返回值错误等机制的语义边界。
主题索引
原子不等于易变、volatile 不等于互斥,读改写为什么必须整体原子,竞态与数据争用的判定,内存屏障与顺序一致,双重检查锁与懒加载的发布问题,以及 Race 检测只覆盖运行路径的局限。
主题索引
比较分级分配、页/块管理与多级缓存降锁等分配器设计。
主题索引
比较编译流程、中间表示、逃逸分析等编译期优化机制及其对代码写法的约束。
主题索引
比较不同语言运行时的回收算法、写屏障、并发标记与调步策略取舍。
主题索引
比较借助类型系统、安全库、编译器与语言选择把错误挡在编码阶段的方法。
主题索引
Go 的 channel、select 与 context:无缓冲通道的同步交接、关闭与 ok 语义、select 默认分支与旁支撤销、取消信号与截止时间如何沿父子任务传播,以及通信表达所有权为什么能把竞态前移到编译期。
主题索引
比较编译器如何从初始化表达式、模板实参推导类型,以及推导结果与直觉不一致的陷阱。
主题索引
比较反射机制换取的动态能力及其可设置性约束和性能代价。
主题索引
比较调用约定、栈帧、栈增长与闭包捕获的运行时实现和成本。