寻找最佳并发
In the Search of Optimal Concurrency
摘要:
实现并发数据结构通常从定义其顺序规范开始。但是,当使用\emph{as is}时,非平凡顺序数据结构(如链表、搜索树或哈希表)可能会暴露错误行为:丢失更新、不一致的响应等。为了确保正确性,必须使用同步原语“保护”对共享数据进行操作的顺序代码部分免受数据竞争的影响,因此,必须拒绝并行操作步骤的某些调度。但是,我们是否可以确保不“过度使用”同步,即,只有当并发调度违反正确性时,我们才拒绝它?在本文中,我们正式对待这个问题,通过引入一个\emph{concurrency-optimal}实现的概念。程序的并发性在这里被定义为它接受并发调度的能力,即,其顺序实现的步骤的交错。如果一个实现接受所有不违反程序正确性的交织,那么它就是并发最优的。我们探讨并发性能的\emph{search}数据结构,可以表示的形式,有向无环图导出插入,删除和搜索操作。我们首次证明了\emph{pessimistic},例如,基于保守锁定)和\emph{optimistic serializable}(例如,基于可串行化事务存储器)搜索数据结构的实现在并发性方面是无法比拟的。具体来说,存在顺序代码的简单交织,其不能被\emph{any}悲观(和\emph{resp.},可串行化乐观)实现接受,但被可串行化乐观实现(和\emph{resp.},悲观)接受。因此,这两个实现类都不是并发最优的。
英文摘要:
Implementing a concurrent data structure typically begins with defining its sequential specification. However, when used \emph{as is}, a nontrivial sequential data structure, such as a linked list, a search tree, or a hash table, may expose incorrect behavior: lost updates, inconsistent responses, etc. To ensure correctness, portions of the sequential code operating on the shared data must be "protected" from data races using synchronization primitives and, thus, certain schedules of the steps of concurrent operations must be rejected. But can we ensure that we do not "overuse" synchronization, i.e., that we reject a concurrent schedule only if it violates correctness? In this paper, we treat this question formally by introducing the notion of a \emph{concurrency-optimal} implementation. A program's concurrency is defined here as its ability to accept concurrent schedules, i.e., interleavings of steps of its sequential implementation. An implementation is concurrency-optimal if it accepts all interleavings that do not violate the program's correctness. We explore the concurrency properties of \emph{search} data structures which can be represented in the form of directed acyclic graphs exporting insert, delete and search operations. We prove, for the first time, that \emph{pessimistic} e.g., based on conservative locking) and \emph{optimistic serializable} e.g., based on serializable transactional memory) implementations of search data-structures are incomparable in terms of concurrency. Specifically, there exist simple interleavings of sequential code that cannot be accepted by \emph{any} pessimistic (and \emph{resp.}, serializable optimistic) implementation, but accepted by a serializable optimistic one (and \emph{resp.}, pessimistic). Thus, neither of these two implementation classes is concurrency-optimal.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。