Model checking has become a key tool for gaining confidence in correctness of multi-threaded programs. Unit tests and functional tests do not suffice because of race conditions that are not discovered by those tests. McMini is an extensible model checker based on DPOR (Dynamic Partial Order Reduction). A mechanism was invented to declare to McMini new, primitive thread operations, typically in 100~lines or less of C~code. The mechanism was extended to also allow the end user to declare alternative thread wakeup policies, including spurious wakeups from condition variables. One declares: (I) under what conditions an operation is enabled; (ii) which thread operations are independent of each other; and (iii) when two operations can be considered as co-enabled. An optional wakeup policy is implemented by defining when a wait operation (on a semaphore, condition variable, etc.) is enabled. A new enqueue thread operation is described, allowing a user to declare alternative wakeup policies. McMini was first confirmed to operate correctly and efficiently as a traditional, but extensible model checker for mutex, semaphore, condition variable, and reader-writer. McMini's extensibility was then tested on novel primitive operations, representing other useful paradigms for multithreaded operations. An example is readers-and-two-writers. The speed of model checking was found to be five times faster and more, as compared to traditional implementations on top of condition variables. Alternative wakeup policies (e.g., FIFO, LIFO, arbitrary, etc.) were then tested using an enqueue operation. Finally, spurious wakeups were tested with a program that exposes a bug only in the presence of a spurious wakeup.
翻译:模型检查已成为获得对多读程序正确性的信心的关键工具。 单位测试和功能测试由于这些测试没有发现种族条件而不够充分。 McMini是基于DPOR( 动态部分降序) 的可扩展模型检查器。 创建了一个机制, 向McMini宣布新的原始线索操作, 通常在100~ 线或低于 C~ 代码。 机制扩大后, 允许终端用户宣布替代的线索唤醒政策, 包括从条件变量中令人毛骨悚然的唤醒。 一个机制宣布:( I) 在什么条件下启用了操作;(ii) 线索操作相互独立; 以及(iii) 两个操作可以被视为共同启用的模型检查器。 启用了一种可选的提醒政策, 在等待操作( 示意图、 条件变量等) 时, 将新的螺丝线操作描述, 使用户能够宣布替代的觉醒醒政策。 McMini首先被确认为传统且有效的操作, 但对于静音、 直线操作是独立的模型检查器、 直径、 运行和滚动操作, 最终测试了操作。 的操作是用来在服务器上, 测试了。 测试了。 测试了。 测试了另一个操作的操作和 。 测试了。 测试了。 。 。 的操作的操作的操作和 。 。 。 在结构的操作的操作的操作的选项在结构的操作在上, 。 。