一种多线程系统的最优向量时钟算法
An Optimal Vector Clock Algorithm for Multithreaded Systems
摘要:
跟踪事件之间的因果关系(或之前发生的关系)对于许多应用程序都很有用,例如调试和从故障中恢复。考虑一个具有$n$线程和$m$对象的并发系统。对于这样的系统,大小为$n$的向量时钟与每个线程一个组件一起使用,或者大小为$m$的向量时钟与每个对象一个组件一起使用。一个自然的问题是,是否可以使用大小严格小于$m$和$n$的最小值的向量时钟来给事件加时间戳。我们在本文中给出了一个算法,使用线程和对象组件的混合。我们的算法保证返回矢量时钟所需的最小数量的组件。我们首先考虑对象和线程之间的交互是静态已知的情况。这种交互是由一个线程对象二分图建模的。我们的算法是基于找到这样的图的最大二分匹配,然后应用König-Egerváry定理来计算最小顶点覆盖,以确定矢量时钟所需的组件的最佳数量。我们还提出了两种机制来计算这样一个向量时钟时,计算显示在一个在线的时尚。不同类型的图上的评估表明,我们的离线算法生成的大小向量时钟是显着小于最小值的$m$和$n$。这些机制在底层二分图不密集时更有效。
英文摘要:
Tracking causality (or happened-before relation) between events is useful for many applications such as debugging and recovery from failures. Consider a concurrent system with $n$ threads and $m$ objects. For such systems, either a vector clock of size $n$ is used with one component per thread or a vector clock of size $m$ is used with one component per object. A natural question is whether one can use a vector clock of size strictly less than the minimum of $m$ and $n$ to timestamp events. We give an algorithm in this paper that uses a hybrid of thread and object components. Our algorithm is guaranteed to return the minimum number of components necessary for vector clocks. We first consider the case when the interaction between objects and threads is statically known. This interaction is modeled by a thread-object bipartite graph. Our algorithm is based on finding the maximum bipartite matching of such a graph and then applying König-Egerváry Theorem to compute the minimum vertex cover to determine the optimal number of components necessary for the vector clock. We also propose two mechanisms to compute such an vector clock when computation is revealed in an online fashion. Evaluation on different types of graphs indicates that our offline algorithm generates a size vector clock which is significantly less than the minimum of $m$ and $n$. These mechanisms are more effective when the underlying bipartite graph is not dense.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。