首页> 外文期刊>Science of Computer Programming >Cooperative types for controlling thread interference in Java
【24h】

Cooperative types for controlling thread interference in Java

机译:Java中用于控制线程干扰的协作类型

获取原文
获取原文并翻译 | 示例

摘要

Multithreaded programs are notoriously prone to unintended interference between concurrent threads. To address this problem, we argue that yield annotations in the source code should document all thread interference, and we present a type system for verifying the absence of undocumented interference in Java programs. Under this type system, well-typed programs behave as if context switches occur only at yield annotations. Thus, well-typed programs can be understood using intuitive sequential reasoning, except where yield annotations remind the programmer to account for thread interference. Experimental results show that yield annotations describe thread interference more precisely than prior techniques based on method-level atomicity specifications. In particular, yield annotations reduce the number of interference points one must reason about by an order of magnitude. The type system is also more precise than prior methods targeting race freedom, and yield annotations highlight all known concurrency defects in our benchmarks. The type system reasons about program behavior modularly via method-level specifications. To alleviate the programmer burden of writing these specifications, we extend our system to support method specification inference, which makes our technique more practical for large code bases.
机译:众所周知,多线程程序易于在并发线程之间发生意外干扰。为了解决这个问题,我们认为源代码中的yield注释应该记录所有线程干扰,并且我们提出一种类型系统来验证Java程序中是否存在未记录的干扰。在这种类型的系统下,类型良好的程序的行为就像上下文切换仅发生在yield注释处一样。因此,可以使用直观的顺序推理来理解类型正确的程序,除非产量注释会提醒程序员注意线程干扰。实验结果表明,与基于方法级原子性规范的现有技术相比,屈服注释更准确地描述了线程干扰。特别是,产量标注将一个人必须推理的干扰点数量减少了一个数量级。类型系统也比以前针对种族自由的方法更为精确,并且收益注释突出了我们基准测试中所有已知的并发缺陷。类型系统通过方法级规范以模块化方式说明程序行为。为了减轻程序员编写这些规范的负担,我们扩展了系统以支持方法规范推断,这使我们的技术对于大型代码库更加实用。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号