知识卡片
跳表用发布标志完成多层链接
并发插入可能要分次接好多层指针。可以用 CAS 设置 fully_linked,由该标记区分未完成节点和已发布节点。若语言不自动管理内存,还需要引用计数或 hazard pointer,保证观察到旧引用的线程完成后才释放节点。
参见 [[跳表按概率建立高速层]]。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
- · Skiplist
原书出处 · 1 处
- Chapter 7. Log-Structured Storage Skiplist · 查看原书依据
We can create a concurrent version of a skiplist by implementing a linearizability scheme that uses an additional fully_linked flag that determines whether or not the node pointers are fully updated.
参考来源
- 位置:《Database Internals》Chapter 7. Log-Structured Storage(book-source:extracted/Database Internals A deep-dive into how distributed data systems work (Alex Petrov)/_epub-src/OEBPS/ch07.html#skiplist,段 207)
- 结论依据:第 207–209 段说明多层更新发布、回收与实现例子。
- 原始内容:We can create a concurrent version of a skiplist by implementing a linearizability scheme that uses an additional fully_linked flag that determines whether or not the node pointers are fully updated.