arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1811.11853cs.PL
收藏

使用类型的安全延迟内存回收

Safe Deferred Memory Reclamation with Types

Ismail Kuru, Colin S. Gordon

摘要:

无锁数据结构中的存储管理仍然是并发编程中的主要挑战。读-复制-更新(RCU)和危险指针等设计技术提供了可行的解决方案,并被广泛应用,取得了很好的效果。这些技术依赖于宽限期的概念:应该释放的节点不会立即释放,所有线程都遵守一个协议,以确保释放线程可以检测到所有可能的读取器何时完成了对对象的使用。这提供了一种安全释放的方法,但只有当这些微妙的协议被正确实现时。我们提出了一个静态类型系统,以确保正确使用的RCU存储管理:从数据结构中删除的节点总是安排在随后的释放,并安排在最多一次释放的节点。作为我们的合理性证明的一部分,我们给出了一个抽象的语义RCU的存储管理原语,捕捉RCU的基本属性。我们的类型系统允许我们给内存安全的RCU链表和二叉搜索树实现的第一个证据,而不需要充分的验证。

英文摘要:

Memory management in lock-free data structures remains a major challenge in concurrent programming. Design techniques including read-copy-update (RCU) and hazard pointers provide workable solutions, and are widely used to great effect. These techniques rely on the concept of a grace period: nodes that should be freed are not deallocated immediately, and all threads obey a protocol to ensure that the deallocating thread can detect when all possible readers have completed their use of the object. This provides an approach to safe deallocation, but only when these subtle protocols are implemented correctly. We present a static type system to ensure the correct use of RCU memory management: that nodes removed from a data structure are always scheduled for subsequent deallocation, and that nodes are scheduled for deallocation at most once. As part of our soundness proof, we give an abstract semantics for RCU memory management primitives which captures the fundamental properties of RCU. Our type system allows us to give the first proofs of memory safety for RCU linked list and binary search tree implementations without requiring full verification.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑