公开并发对象的非原子方法
Exposing Non-Atomic Methods of Concurrent Objects
摘要:
多线程软件通常使用专门的并发对象(如原子整数、队列和映射)构建。这些对象的方法被设计为根据某些一致性标准(如原子性)进行行为,尽管被优化以避免阻塞和利用并行性,例如,通过使用原子机器指令,如比较和交换(cmpxchg)。暴露原子性违反是很重要的,因为它们通常会导致难以识别、复制和最终修复的难以捉摸的错误。在这项工作中,我们暴露了原子性侵犯并发对象实现最广泛使用的软件开发工具包:Java开发工具包(JDK)。我们见证原子性违规通过简单的测试工具,包含几个并发的方法调用。虽然压力测试在暴露违规方面是有效的,给出了催化剂测试工具和伪造原子性的轻量级手段,但预测有效的催化剂可能很困难,并且原子性检查通常很麻烦。我们克服了这些问题,通过自动化测试线束搜索,并建立原子通过预先计算的可接受的返回值结果集的成员资格。我们的方法可以每秒测试每个线束的数百万次执行(每个处理器核心)。这个规模是重要的,因为原子性违反在极少数的执行(数百到数千分之一)中观察到。我们的实现是开源的,公开可用。
英文摘要:
Multithreaded software is typically built with specialized concurrent objects like atomic integers, queues, and maps. These objects' methods are designed to behave according to certain consistency criteria like atomicity, despite being optimized to avoid blocking and exploit parallelism, e.g., by using atomic machine instructions like compare and exchange (cmpxchg). Exposing atomicity violations is important since they generally lead to elusive bugs that are difficult to identify, reproduce, and ultimately repair. In this work we expose atomicity violations in concurrent object implementations from the most widely-used software development kit: The Java Development Kit (JDK). We witness atomicity violations via simple test harnesses containing few concurrent method invocations. While stress testing is effective at exposing violations given catalytic test harnesses and lightweight means of falsifying atomicity, divining effectual catalysts can be difficult, and atomicity checks are generally cumbersome. We overcome these problems by automating test-harness search, and establishing atomicity via membership in precomputed sets of acceptable return-value outcomes. Our approach enables testing millions of executions of each harness each second (per processor core). This scale is important since atomicity violations are observed in very few executions (tens to hundreds out of millions) of very few harnesses (one out of hundreds to thousands). Our implementation is open source and publicly available.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。