首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 468 毫秒
1.
Java虚拟机使用锁机制来实现多线程共享数据结构的同步.锁机制维护的临界区通常对共享数据结构只进行读操作.只读锁是指当某个线程持有锁在只读临界区时,其他线程可以直接进入只读临界区而无需等待.只读锁能极大地提高锁机制的同步性能.Java虚拟机的锁机制可分为轻量级锁和重量级锁两层,当线程冲突时从轻量级锁转向重量级锁.本文分别从轻量级锁和重量级锁两个层次分别进行只读锁优化.轻量级锁的只读优化算法可以减少原子操作的开销;重量级锁的只读优化算法则可以使多个线程同时在只读临界区中.最后在Java虚拟机HotSpot中实现只读锁优化,并且在龙芯3A上进行实验.性能测试用例包括单线程Java程序、多线程Java程序以及SPECjvm2008.实验结果表明,上述优化方法能极大降低线程进入和退出只读临界区的开销,提高Java虚拟机的同步性能.  相似文献   

2.
依托基于内核的虚拟机(kernel-based virtual machine , KVM )的平台,针对虚拟机容错系统中的关键技术---虚拟锁步技术展开研究,主要研究虚拟锁步技术所采用的虚拟机同步机制(VM synchronization mechanism )。对开源虚拟机容错软件Kemari进行架构剖析与代码分析,指出其所使用的基于数据拷贝的虚拟机同步机制在不使用共享存储进行锁步运行时,具有一定性能缺陷;以此为基础,提出相应的改进措施,设计并实现一种新的虚拟机同步机制。该机制采用事件重放的方式实现冗余虚拟机间块设备数据的同步,弥补了Kemari虚拟机同步机制的相关性能缺陷。  相似文献   

3.
李春江  唐滔  杨灿群 《计算机科学》2013,40(9):35-37,60
硬件锁用简单的取数指令实现“取并加一”或“取并减一”的原子操作.首先介绍了通用多核多线程FT处理器实现的硬件锁机制,并和软件锁机制进行了比较,之后介绍了使用硬件锁机制实现多线程同步的方法,然后在GNUOpenMP运行库中设计并实现了利用硬件锁的多线程同步机制,最后采用典型OpenMP测试程序对使用硬件锁和使用软件锁的同步操作性能进行了评估和分析.  相似文献   

4.
本文以Java的多线程为研究对象,阐述了Java线程的同步机制、模型及调度,讨论了Java在语言级对多线程的支持,并对Java环境下多线程程序的开发及应用进行了较深入的探讨。  相似文献   

5.
李茜  肖萍 《计算机应用》2012,32(6):1727-1729
为了改进Dalvik虚拟机的性能,提出了一种基于多线程调度机制的Java虚拟机混合并发模式。该模式利用多线程并发调度和热方法表,通过将Java字节码的编译与执行过程相重叠来提高程序的执行效率,进而提升Dalvik虚拟机的处理速度;并对该模式设计与实现的关键技术进行了分析。实验结果表明,混合并发模式能够有效地提高Dalvik虚拟机中Java程序的执行速度。  相似文献   

6.
基于Java多线程的并发机制的研究和实现   总被引:4,自引:0,他引:4  
针对高可靠性、高质量的Java并行多任务程序设计,分析了Java多线程机制的原理及其实现技术,研究了程序并发过程中的同步机制和交互通信机制,比较了基于操作系统级和基于Java多线程级并发机制的实现结构,总结了并发程序中死锁预防的一些编程规则和策略。所构造的一个具有完全意义上的并发同步的框架实例有一定的实用价值。  相似文献   

7.
自动垃圾回收技术是Java的核心技术之一。垃圾回收耗时的不确定性阻碍了Java在实时过程中的应用。基于最大响应时间分析方法,利用Petri网分析了垃圾回收过程。通过Java虚拟机内部堆空间的合理划分和采用多线程同步技术可以降低垃圾回收中的停滞现象,提高Java程序的执行速度和实时性。  相似文献   

8.
针对高可靠性、高质量的Java并行多任务程序设计,分析了Java多线程机制的原理及其实现技术,研究了程序并发过程中的同步机制和交互通信机制,比较了基于操作系统级和基于Java多线程级并发机制的实现结构,总结了并发程序中死锁预防的一些编程规则和策略.所构造的一个具有完全意义上的并发同步的框架实例有一定的实用价值.  相似文献   

9.
Java通过“同步”机制为多线程面向对象程序设计避免“相干性”破坏数据一致性提供了一种可行的手段,但这种手段若使用不当,则会造成死锁。针对Java同步机制提出Java多线程程序死锁潜在可能性分析的一种方法,进一步描述了该方法中使用的CHD/LCSD图的构造算法及实现。  相似文献   

10.
Java语言实现了在语言级对多线程技术的支持.多线程技术不仅能提高系统资源的利用率,而且还能提高程序的交互性能和实时控制性能.本文阐述了Java语言实现多线程的方法,分析了多线程并发执行所引起的冲突问题、Java提供的同步机制和多线程的管理策略.  相似文献   

11.
Java 虚拟机用户级多线程的设计与实现   总被引:5,自引:0,他引:5  
丁宇新  程虎 《软件学报》2000,11(5):701-706
详细介绍了国产开放系统平台Java虚拟机多线程的设计与实现.在线程调度上,采用带有独立队列的静态级别轮巡调度,较好地解决了独立循环线程的调度问题.对于线程的同步,采用了哈希混合锁的设计方案.实验结果证明,该锁具有空间小、执行效率高等特点.  相似文献   

12.
俞松  郑骏  杨云 《微处理机》2010,31(1):79-82,85
Java存储模型是Java语言和Java虚拟机研究中的核心关键部分。Java语言规范规定:所有对基本类型的操作,除了对double/long类型的操作之外,都必须是原子级的。Java提供的volatile关键字可以使double/10ng变量实现变量级同步,但仍不能保证线程间同步。针对这些不足,结合实例分析了Java内存模型,syllchmnized方法,引入了硬件原语(CAS),给出了非阻塞算法的同步策略。  相似文献   

13.
介绍无应答严次序发布传播复制策略的定义、准则和算法,并给出Java现实中教据表及按心对象的定义、线程与Connection间的封锁关系速查表。该策略在集群服务器节点中容错4地复制备种文件、探作和教据更新。其中,双钥锁允许加锁者或下一个申请者释放互斥锁,次序管理遵循四个准则避免乱序、意图歪曲、因果牵制和反向因果牵制四个教据不一致问题,全局/局部/状态次序编号为检查和恢复组播教据异常提供了依据并可延迟到更新前进行。  相似文献   

14.
We provide a rigorous framework for language and platform independent design and analysis of exception handling mechanisms in modern programming languages and their implementations. To illustrate the practicality of the method we develop it for the exception handling mechanism of Java and show that its implementation on the Java Virtual Machine (JVM) Is correct. For this purpose we define precise abstract models for exception handling in Java and in the JVM and define a compilation scheme of Java to JVM code which allows us to prove that, in corresponding runs, Java and the JVM throw the same exceptions and with equivalent effect. Thus, the compilation scheme can, with reasonable confidence, be used as a standard reference for Java exception handling compilation  相似文献   

15.
There are many mechanisms for concurrency control in high-level programming languages. In Java, the original mechanism for concurrency control, based on synchronized blocks, is lexically scoped. For more flexible control, Java 5 introduced non-lexical lock primitives on re-entrant locks.These operators may lead to run-time errors and unwanted behavior; e.g., taking a lock without releasing it, which could lead to a deadlock, or trying to release a lock without owning it. This paper develops a static type and effect system to prevent the mentioned lock errors for a formal, object-oriented calculus which supports non-lexical lock handling and exceptions.Based on an operational semantics, we prove soundness of the effect type analysis. Challenges in the design of the effect type system are dynamic creation of threads, objects, and especially of locks, aliasing of lock references, passing of lock references between threads, and reentrant locks as found in Java. Furthermore, the exception handling mechanism complicates the control-flow and thus the analysis.  相似文献   

16.
This paper describes JaRec, a portable record/replay system for Java. It correctly replays multi‐threaded, data‐race free Java applications, by recording the order of synchronization operations, and by executing them in the same order during replay. The record/replay infrastructure is developed in Java, and does not require a modification of the Java Virtual Machine (JVM) if it provides the JVM Profiler Interface (JVMPI). If the JVM does not support JVMPI, which is used for intercepting the loaded classes, only a minor modification to the JVM is required in order to run the system. On ystems with limited memory resources, JaRec can be executed in a distributed fashion. This also makes it suitable to aid debugging of multi‐threaded applications on embedded systems. Copyright © 2004 John Wiley & Sons, Ltd.  相似文献   

17.
JavaSplit is a portable runtime environment for distributed execution of standard multithreaded Java programs. It gains augmented computational power and increased memory capacity by distributing the threads and objects of an application among the available machines. Unlike previous works, which either forfeit Java portability by using a nonstandard Java Virtual Machine (JVM) or compromise transparency by requiring user intervention in making the application suitable for distributed execution, JavaSplit automatically executes standard multithreaded Java on any heterogenous collection of Java-enabled machines. Each machine carries out its part of the computation using nothing but its local standard (unmodified) JVM. Neither the programmer nor the person submitting the program for execution needs to be aware of JavaSplit or its distributed nature. We evaluate the efficiency of JavaSplit on several combinations of operating systems, JVM implementations, and communication hardware.  相似文献   

18.
Since Java security relies on the type-safety of the JVM, many formal approaches have been taken in order to prove the soundness of the JVM. This paper presents a new formalization of the JVM and proves its soundness. It is the first model to employ dynamic linking and bytecode verification to analyze the loading constraint scheme of Java2. The key concept required for proving the soundness of the new model is augmented value typing, which is defined from ordinary value typing combined with the loading constraint scheme. In proving the soundness of the model, it is shown that there are some problems inside the current reference implementation of the JVM with respect to our model. We also analyze the findClass scheme, newly introduced in Java2. The same analysis also shows why applets cannot exploit the type-spoofing vulnerability reported by Saraswat, which led to the introduction of the loading constraint scheme.  相似文献   

19.
The cluster virtual machine (VM) for Java provides a single system image of a traditional Java Virtual Machine (JVM) while executing in a distributed fashion on the nodes of a cluster. The cluster VM for Java virtualizes the cluster, supporting any pure Java application without requiring that application be tailored specifically for it. The aim of our cluster VM is to obtain improved scalability for a class of Java Server Applications by distributing the application's work among the cluster's computing resources. The implementation of the cluster VM for Java is based on a novel object model which distinguishes between an application's view of an object (e.g. every object is a unique data structure) and its implementation (e.g. objects may have consistent replications on different nodes). This enables us to exploit knowledge on the use of individual objects to improve performance (e.g. using object replications to increase locality of access to objects). We have already completed a prototype that runs pure Java applications on a cluster of NT workstations connected by a Myrinet fast switch. The prototype provides a single system image to applications, distributing the application's threads and objects over the cluster. We used the cluster VM to run, without change, a real Java Server Application containing over 10 Kloc
  • 1 Kloc means Kilo lines of code—used to describe the size of applications in terms of source lines count.
  • for the source code and achieved high scalability for it on a cluster. We also achieved linear speedup for another application with a large number of independent threads. This paper discusses the architecture and implementation of the cluster VM. It focuses on achieving a single system image for a traditional JVM on a cluster while describing, in short, how we aim to obtain scalability. Copyright © 2001 John Wiley & Sons, Ltd.  相似文献   

    20.
    Dynamic software updating is critical for many systems that must provide continuous service. In addition, the Java language is gaining increasing popularity in developing distributed systems. Most previous works on updating are concerned with safely updating one class every time. It has many limitations on updating classes, such as not allowing deleting methods invoked in other classes. In this paper, the update transaction is purposed to dynamically update the class set, and some of its properties are discussed, such as atomicity, consistency, isolation, and durability (ACID). Then the property of type-safety is proven formally. In order to update without changing the Java Virtual Machine (JVM) and the Java programming language, this paper proposes a new implementation method. The method makes use of the Java class loading mechanism and reflection mechanism. We also present how to design an updatable Java program and a Java updating program. At the end of the paper, an experiment is made for analysis.  相似文献   

    设为首页 | 免责声明 | 关于勤云 | 加入收藏

    Copyright©北京勤云科技发展有限公司  京ICP备09084417号