用于并发执行中因果序的树时钟数据结构
A Tree Clock Data Structure for Causal Orderings in Concurrent Executions
AI总结:
本文提出了树时钟这一新数据结构,替代向量时钟以高效计算并发程序执行中的因果序,有效克服了线程数较大时的计算瓶颈,并在 HB、SHB 和 MAZ 偏序计算中实现了显著的性能提升。
摘要:
动态技术是一种可扩展且有效的方法,用于分析并发程序。这些技术不是分析程序的所有行为,而是通过关注单次程序执行来检测错误。这些技术中的一个关键步骤通常是定义执行中事件之间的因果序,然后使用向量时钟来计算它,向量时钟是一种存储线程逻辑时间的简单数据结构。向量时钟的两个基本操作,即合并和复制,需要 $Θ(k)$ 的时间,其中 $k$ 是线程数。因此,当 $k$ 很大时,它们成为了计算瓶颈。在这项工作中,我们引入了树时钟,这是一种新的数据结构,用于替代向量时钟来计算程序执行中的因果序。合并和复制树时钟所需的时间大致与被修改条目的数量成正比,因此这两个操作不会受到每次应用时先验的 $Θ(k)$ 成本的影响。我们证明,当用于计算经典的 happens-before (HB) 偏序时,树时钟是最优的,即没有其他数据结构能产生更小的渐近运行时间。此外,我们证明了树时钟可用于计算其他偏序,例如 schedulable-happens-before (SHB) 和标准的 Mazurkiewicz (MAZ) 偏序,因此它是一种通用的数据结构。我们的实验表明,仅通过用树时钟替代向量时钟,每个基准测试的计算平均变快了 $2.02 \ imes$ (MAZ) 到 $2.66 \ imes$ (SHB) 和 $2.97 \ imes$ (HB)。这些结果表明,树时钟有潜力成为一种在并发分析中具有广泛应用的标准数据结构。
英文摘要:
Dynamic techniques are a scalable and effective way to analyze concurrent programs. Instead of analyzing all behaviors of a program, these techniques detect errors by focusing on a single program execution. Often a crucial step in these techniques is to define a causal ordering between events in the execution, which is then computed using vector clocks, a simple data structure that stores logical times of threads. The two basic operations of vector clocks, namely join and copy, require $Θ(k)$ time, where $k$ is the number of threads. Thus they are a computational bottleneck when $k$ is large. In this work, we introduce tree clocks, a new data structure that replaces vector clocks for computing causal orderings in program executions. Joining and copying tree clocks takes time that is roughly proportional to the number of entries being modified, and hence the two operations do not suffer the a-priori $Θ(k)$ cost per application. We show that when used to compute the classic happens-before (HB) partial order, tree clocks are optimal, in the sense that no other data structure can lead to smaller asymptotic running time. Moreover, we demonstrate that tree clocks can be used to compute other partial orders, such as schedulable-happens-before (SHB) and the standard Mazurkiewicz (MAZ) partial order, and thus are a versatile data structure. Our experiments show that just by replacing vector clocks with tree clocks, the computation becomes from $2.02 \times$ faster (MAZ) to $2.66 \times$ (SHB) and $2.97 \times$ (HB) on average per benchmark. These results illustrate that tree clocks have the potential to become a standard data structure with wide applications in concurrent analyses.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。