The \emph{Order-Maintenance} (OM) data structure maintains a total order list of items for insertions, deletions, and comparisons. As a basic data structure, OM has many applications, such as maintaining the topological order, core numbers, and truss in graphs, and maintaining ordered sets in Unified Modeling Language (UML) Specification. The prevalence of multicore machines suggests parallelizing such a basic data structure. This paper proposes a new parallel OM data structure that supports insertions, deletions, and comparisons in parallel. Specifically, parallel insertions and deletions are synchronized by using locks efficiently, which achieve up to $7$x and $5.6$x speedups with $64$ workers. One big advantage is that the comparisons are lock-free so that they can execute highly in parallel with other insertions and deletions, which achieve up to $34.4$x speedups with $64$ workers. Typical real applications maintain order lists that always have a much larger portion of comparisons than insertions and deletions. For example, in core maintenance, the number of comparisons is up to 297 times larger compared with insertions and deletions in certain graphs. This is why the lock-free order comparison is a breakthrough in practice.
翻译:顺序维护(Order-Maintenance,简称OM)数据结构用于维护一个支持插入、删除与比较操作的全序列表。作为一种基础数据结构,OM具有广泛的应用,例如维护图的拓扑序、核数(core numbers)与三角核(truss),以及在统一建模语言(UML)规范中维护有序集合。多核机器的普及使得并行化此类基础数据结构具有重要意义。本文提出了一种新型并行OM数据结构,支持并行的插入、删除与比较操作。具体而言,并行插入与删除操作通过高效锁机制实现同步,在使用64个工作线程时分别取得最高7倍与5.6倍的加速比。该结构的一大优势在于比较操作是无锁的,因而能够与其它插入删除操作高度并行执行,在使用64个工作线程时取得最高34.4倍的加速比。典型的实际应用所维护的顺序列表中,比较操作的数量通常远多于插入与删除操作。例如在核数维护场景中,某些图的比较操作次数可达插入删除操作次数的297倍。这正是无锁顺序比较机制在实践中具有突破性意义的原因。