首页> 外文学位 >Implementation and optimization of thread-local variables for a race-free Java dialect.
【24h】

Implementation and optimization of thread-local variables for a race-free Java dialect.

机译:非竞赛Java语言的线程局部变量的实现和优化。

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

摘要

Despite the popularity of Java, problems may arise from potential data-race conditions during execution of a Java program. Data-races are considered errors in concurrent programming languages and greatly complicate both programming and runtime optimization efforts. A race-free version of Java is therefore desirable as a way of avoiding this complexity and simplifying the programming model.;This thesis is part of work trying to build a race-free version of Java. It implements and optimizes thread-local accesses and comes up with a new semantics for this language. An important part of implementing a language without races is to distinguish thread-local data from shared data because these two groups of data need to be treated differently. This is complex in Java because in the current Java semantics all objects are allocated on a single heap and implicitly shared by multiple threads. Furthermore, while Java does provide a mechanism for thread-local storage, it is awkward to use and inefficient.;Many of the new concurrent programming languages, such as OpenMP, UPC, and D, use "sharing directives" to distinguish shared data from thread-local data, and have features that make heavy use of thread-local data. Our goal here is to apply some of these language ideas to a Java context in order to provide a simpler and less error-prone programming model. When porting such features as part of a language extension to Java, however, performance can suffer due to the simple, map-based implementation of Java's built-in ThreadLocal class. We implement an optimized mechanism based on programmer annotations that can efficiently ensure class and instance variables are only accessed by their owner thread. Both class and instance variables inherit values from the parent thread through deep copying, allowing all the reachable objects of child threads to have local copies if syntactically specified. In particular, class variable access involves direct access to thread-local variables through a localized heap, which is faster and easier than the default map mechanism defined for ThreadLocal objects. Our design improves performance significantly over the traditional thread-local access method for class variables and provides a simplified and more appealing syntax for doing so. We further evaluate our approach by modifying non-trivial, existing benchmarks to make better use of thread-local features, illustrating feasibility and allowing us to measure the performance in realistic contexts. This work is intended to bring us closer to designs for a complete race-free version of Java, as well as show how improved support for use of thread-local data could be implemented in other languages.
机译:尽管Java很流行,但是在执行Java程序期间可能由于潜在的数据争用条件而产生问题。数据争用被视为并发编程语言中的错误,极大地使编程和运行时优化工作复杂化。因此,为了避免这种复杂性并简化编程模型,希望使用Java的无种族版本。;本论文是试图构建Java的无种族版本的工作的一部分。它实现并优化了线程本地访问,并为此语言提供了新的语义。实现不带种族的语言的重要部分是区分线程本地数据和共享数据,因为这两组数据需要区别对待。这在Java中很复杂,因为在当前的Java语义中,所有对象都分配在单个堆上,并由多个线程隐式共享。此外,尽管Java确实提供了用于线程本地存储的机制,但使用起来很尴尬且效率低下。;许多新的并发编程语言,例如OpenMP,UPC和D,都使用“共享指令”将共享数据与线程本地数据,并具有大量使用线程本地数据的功能。我们的目标是将这些语言思想中的一些应用于Java上下文,以提供更简单,更不易出错的编程模型。但是,当将这些功能作为Java语言扩展的一部分进行移植时,由于Java内置ThreadLocal类的基于地图的简单实现,性能可能会受到影响。我们基于程序员注释实现了一种优化的机制,可以有效地确保类和实例变量仅由其所有者线程访问。类变量和实例变量都通过深度复制从父线程继承值,如果在语法上指定,则允许子线程的所有可访问对象都具有本地副本。特别地,类变量访问涉及通过本地化堆直接访问线程局部变量,这比为ThreadLocal对象定义的默认映射机制更快,更容易。我们的设计比传统的针对类变量的线程局部访问方法显着提高了性能,并为此提供了一种简化且更具吸引力的语法。我们通过修改现有的非平凡基准来进一步评估我们的方法,以更好地利用线程局部功能,说明可行性并允许我们在实际环境中衡量性能。这项工作旨在使我们更接近完整的Java竞赛版本的设计,并展示如何以其他语言实现对使用线程本地数据的改进支持。

著录项

  • 作者

    Zhang, Yi.;

  • 作者单位

    McGill University (Canada).;

  • 授予单位 McGill University (Canada).;
  • 学科 Computer science.
  • 学位 M.Sc.
  • 年度 2012
  • 页码 77 p.
  • 总页数 77
  • 原文格式 PDF
  • 正文语种 eng
  • 中图分类
  • 关键词

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号