论文标题
与并发数据结构的应用程序的恒定时间快照
Constant-Time Snapshots with Applications to Concurrent Data Structures
论文作者
论文摘要
我们提出了一种有效拍摄CAS对象的状态快照的方法。拍摄快照允许以后的操作读取在拍摄快照时每个CAS对象具有的值。拍摄快照需要恒定的步骤,并将手柄返回到快照。使用此句柄读取单个CAS对象的快照值是免费的,因为拍摄了快照以来,与对象的成功案例的数量成正比。我们的快速,灵活的快照可在与CAS对象构建的并发数据结构上对原子多点查询进行简单,有效的实现。例如,在使用CAS更新子指针的搜索树中,一旦拍摄了快照,就可以原子搜索钥匙范围,找到与某些条件匹配的第一个键,或者仅通过在树上快照上运行标准的顺序算法来检查键的集合。 为了评估我们的方法的性能,我们将其应用于两个搜索树,一棵平衡,一个不平衡。实验表明,在各种工作量中,支撑快照的开销较低。此外,在几乎所有情况下,通过我们的快照构建的树木上的范围查询都比支持原子范围查询的最新同时数据结构的性能和更好或更好。
We present an approach for efficiently taking snapshots of the state of a collection of CAS objects. Taking a snapshot allows later operations to read the value that each CAS object had at the time the snapshot was taken. Taking a snapshot requires a constant number of steps and returns a handle to the snapshot. Reading a snapshotted value of an individual CAS object using this handle is wait-free, taking time proportional to the number of successful CASes on the object since the snapshot was taken. Our fast, flexible snapshots yield simple, efficient implementations of atomic multi-point queries on concurrent data structures built from CAS objects. For example, in a search tree where child pointers are updated using CAS, once a snapshot is taken, one can atomically search for ranges of keys, find the first key that matches some criteria, or check if a collection of keys are all present, simply by running a standard sequential algorithm on a snapshot of the tree. To evaluate the performance of our approach, we apply it to two search trees, one balanced and one not. Experiments show that the overhead of supporting snapshots is low across a variety of workloads. Moreover, in almost all cases, range queries on the trees built from our snapshots perform as well as or better than state-of-the-art concurrent data structures that support atomic range queries.