It is becoming increasingly difficult to improve the performance of a a single process (thread) on a computer due to physical limitations. Modern systems use multi-core processors in which multiple processes (threads) may run concurrently. A lock-free data structure can allow these processes to communicate with each other without requiring mutual exclusion, and may increase the amount of work they may perform in parallel rather than sequentially, thus improving the performance of the system as a whole. This paper contains an implementation of Ko's Lock-Free Binary Trie, which stores a dynamic set of keys from an ordered universe. It supports insert, remove, search and predecessor operations. One novel component of this implementation is a lock-free linked list which allows multiple processes to attempt to insert the same node, but which prevents a node from being reinserted once it has been removed from the list. The final section of this paper contains an experimental comparison of this implementation against other data structures which implement the same abstract data type (ADT) as the lock-free trie. Analysis of these experiments reveal that the implementation of Ko's Trie performs better than existing theoretical implementations of this ADT when the universe of keys is large, when removes are rare and when the number of processes performing operations concurrently is low.
翻译:由于物理限制,提升计算机中单个进程(线程)的性能正变得越来越困难。现代系统采用多核处理器,允许多个进程(线程)并发运行。无锁数据结构使得这些进程能够在不需互斥的情况下相互通信,并可能增加它们并行而非顺序执行的工作量,从而提升系统整体性能。本文实现了 Ko 的无锁二叉字典树,该结构用于存储来自有序全域的动态键值集合,支持插入、删除、查找和前驱操作。本实现的一个新颖组件是一个无锁链表,它允许多个进程尝试插入同一节点,但能防止节点从链表中移除后被重新插入。本文最后部分通过实验将该实现与实现相同抽象数据类型(ADT)的其他数据结构进行了比较。实验分析表明,当键值全域较大、删除操作较少且并发执行操作的进程数较低时,Ko 字典树的实现性能优于该 ADT 的现有理论实现。