知识卡片
映射表CAS发布新增量
父节点只指向稳定逻辑 ID,映射表将 ID 解析为当前物理链头。写者创建指向旧链头的增量,然后用已读指针做 CAS 比较并发布。失去竞争的一方重新定位再尝试;读者随原子更新前后的任一指针,都能沿完整的不可变链读取。
参见 [[Bw树用增量链表示节点]]。
结构图:
flowchart LR
P[父节点上的逻辑 ID] --> M[映射表]
M -->|发布后| N[新增量]
N --> O[旧增量或基节点]
M -. 发布前 .-> O
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
- · Bw-Trees
原书出处 · 1 处
- Chapter 6. B-Tree Variants Bw-Trees · 查看原书依据
An update operation during step 3 can be done using compare-and-swap, which is an atomic operation, so all reads, concurrent to the pointer update, are ordered either before or after the write, without blocking either the readers
参考来源
- 位置:《Database Internals》Chapter 6. B-Tree Variants(book-source:extracted/Database Internals A deep-dive into how distributed data systems work (Alex Petrov)/_epub-src/OEBPS/ch06.html#idm46104531947928,段 84)
- 结论依据:第 77–84 段呈现寻址、构造、发布和重试。
- 原始内容:An update operation during step 3 can be done using compare-and-swap, which is an atomic operation, so all reads, concurrent to the pointer update, are ordered either before or after the write, without blocking either the readers