arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2012.14542cs.DCcs.DScs.PL
收藏

NBR:基于中和的回收

NBR: Neutralization Based Reclamation

Ajay Singh, Trevor Brown, Ali Mashtizadeh

摘要:

安全内存回收(SMR)算法受到限制未回收内存和回收速度之间的权衡。基于危险指针(HP)的算法始终绑定未回收的内存,但往往比其他方法慢。基于历元的回收(EBR)算法更快,但不限制内存回收。其他算法遵循混合方法,需要特殊的编译器或硬件支持,改变记录布局,和/或广泛的代码更改。并非所有SMR算法都可用于回收所有数据结构的内存。我们提出了一个新的中和回收(NBR)算法,是最好的已知的EBR算法的速度,并实现有界未回收的内存。当与非阻塞操作系统(OS)内核一起使用时,它是非阻塞的,并且只需要原子读,写和CAS。NBR可以直接用于许多不同的数据结构,并且在大多数情况下,需要类似的推理和程序员工作来实现两阶段锁定。NBR是使用OS信号和参与线程之间的轻量级握手机制来确定何时回收记录是安全的。基于锁的二叉搜索树和一个懒惰的链表上的实验表明,NBR显着优于许多国家的最先进的回收算法。在树中,NBR比下一个最佳算法快,DEBRA高达38%,HP高达17%。而且,在列表中,NBR分别比DEBRA和HP快15%和243%。

英文摘要:

Safe memory reclamation (SMR) algorithms suffer from a trade-off between bounding unreclaimed memory and the speed of reclamation. Hazard pointer (HP) based algorithms bound unreclaimed memory at all times, but tend to be slower than other approaches. Epoch based reclamation (EBR) algorithms are faster, but do not bound memory reclamation. Other algorithms follow hybrid approaches, requiring special compiler or hardware support, changes to record layouts, and/or extensive code changes. Not all SMR algorithms can be used to reclaim memory for all data structures. We propose a new neutralization based reclamation (NBR) algorithm that is faster than the best known EBR algorithms and achieves bounded unreclaimed memory. It is non-blocking when used with a non-blocking operating system (OS) kernel, and only requires atomic read, write and CAS. NBR is straightforward to use with many different data structures, and in most cases, require similar reasoning and programmer effort to two-phased locking. NBR is implemented using OS signals and a lightweight handshaking mechanism between participating threads to determine when it is safe to reclaim a record. Experiments on a lock-based binary search tree and a lazy linked list show that NBR significantly outperforms many state of the art reclamation algorithms. In the tree NBR is faster than next best algorithm, DEBRA by upto 38% and HP by upto 17%. And, in the list NBR is 15% and 243% faster than DEBRA and HP, respectively.

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

↑