基于向量时钟的消息传递Go程序的两阶段动态分析
Two-Phase Dynamic Analysis of Message-Passing Go Programs based on Vector Clocks
摘要:
理解并发程序的运行时行为是一项具有挑战性的任务。一种流行的方法是通过矢量时钟建立一个发生在之前的关系。因此,我们可以识别错误和性能瓶颈,例如,通过检查两个冲突事件是否可能并发发生。我们采用两阶段的方法来获得向量时钟信息,用于广泛的并发功能,包括Go中的所有消息传递功能。第一阶段(插装和跟踪)生成一个运行时跟踪,记录发生的与消息传递并发相关的所有事件。第二阶段(轨迹重放)在线执行,并重放记录的轨迹以推断矢量时钟信息。跟踪重放对线程本地跟踪进行操作。因此,我们可以观察到可能由某种替代时间表导致的不确定性。我们的方法不依赖于任何特定的语言。我们已经为Go程序设计语言构建了一个原型,并为我们的方法的实用性提供了经验证据。
英文摘要:
Understanding the run-time behavior of concurrent programs is a challenging task. A popular approach is to establish a happens- before relation via vector clocks. Thus, we can identify bugs and per- formance bottlenecks, for example, by checking if two con icting events may happen concurrently. We employ a two-phase method to derive vector clock information for a wide range of concurrency features that includes all of the message-passing features in Go. The rst phase (instrumentation and tracing) yields a run-time trace that records all events related to message-passing concurrency that took place. The second phase (trace replay) is carried out o ine and replays the recorded traces to infer vector clock information. Trace replay operates on thread-local traces. Thus, we can observe behav- ior that might result from some alternative schedule. Our approach is not tied to any speci c language. We have built a prototype for the Go programming language and provide empirical evidence of the usefulness of our method.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。