一句话:提出一种证明程序对 C/C++11 内存模型具有鲁棒性的方法,从而可在顺序一致性语义下推理且不牺牲性能。
并发程序正确性推理困难。顺序一致性(SC)语义便于推理,但同步开销高;C/C++11 内存模型试图在性能与推理之间取得平衡,却比预期复杂,连领域专家也难以掌握。本文提出一种方法,使程序员无需牺牲性能即可按 SC 语义推理程序正确性。其核心是证明程序相对于 C/C++11 内存模型的鲁棒性(robustness):一旦程序被证明鲁棒,它只可能表现出 SC 行为,因此可以完全用 SC 语义进行推理。该方法为在弱内存模型下使用强语义推理提供了途径。
Concurrency is extremely useful, however reasoning about the correctness of concurrent programs is more difficult than ever. Sequential consistency (SC) semantics provide the ability to reason about correctness, however these come at a high synchronization cost. C11 introduced a memory model that was supposed to help with these problems, attempting to provide balance between performance and reasoning. However, this model was much more complicated than expected, proving to be a challenge even for domain experts. We propose a method that enables the programmer to reason about correctness with SC semantics without compromising performance. By proving robustness of a program it can only exhibit SC behaviors and can thus be reasoned about with SC semantics.