锁定规范的语义
Semantics for Locking Specifications
摘要:
为了防止并发错误,程序员需要遵守锁规则。指定该规程的注释,如Java的@GuardedBy,已经被广泛使用。不幸的是,它们的语义是非正式表达的,因此是模糊的。本文重点介绍了这种二义性,并以两种替代方式形式化了@GuardedBy的语义,这两种方式是基于一种类似Java语言的小型并发片段的操作语义构建的。它还确定了这种注释何时是对数据竞争的实际保证。我们的工作有助于理解注释,并支持开发健全的正式工具来验证或推断这些注释。
英文摘要:
To prevent concurrency errors, programmers need to obey a locking discipline. Annotations that specify that discipline, such as Java's @GuardedBy, are already widely used. Unfortunately, their semantics is expressed informally and is consequently ambiguous. This article highlights such ambiguities and formalizes the semantics of @GuardedBy in two alternative ways, building on an operational semantics for a small concurrent fragment of a Java-like language. It also identifies when such annotations are actual guarantees against data races. Our work aids in understanding the annotations and supports the development of sound formal tools that verify or infer such annotations.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。