Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Enhancements to Java for Real Time Systems Theresa Dsena CSE 666 - Fall 2006 Prof. Ganesan Contents Limitations of Standard Java Overview of RTSJ Guiding Principles of RTSJ Enhancements to Standard Java Concluding notes on RTSJ 16/10/06 CSE 666 - Fall 2006 2 Limitations of Standard Java Major Weakness Garbage The garbage collector de-allocates objects from the memory heap in no particular order. This non-deterministic behavior could interrupt application execution for unpredictable intervals of time Thread 16/10/06 Collection Scheduling The JVM (Java Virtual Machine) relies on the host operating systems thread scheduler. The operating system must be capable of real-time scheduling CSE 666 - Fall 2006 3 Overview of RTSJ The Real Time for Java Experts Group (RTJEG) has been developing Real Time Specification for Java (RTSJ) since 1999 under the Java community process RTSJ specifies enhancements to standard Java, specifically for JVM and creation of real time API 16/10/06 CSE 666 - Fall 2006 4 Guiding Principles of RTSJ Applicability to all Java environments Backward compatibility Write once, run anywhere Current real time practices and future implementations Priority to predictable execution 16/10/06 CSE 666 - Fall 2006 5 Enhancements to Standard Java Thread scheduling and dispatching Memory management Thread synchronization Asynchronous event handling Asynchronous transfer of control Asynchronous thread termination Physical memory access 16/10/06 CSE 666 - Fall 2006 6 Enhancements to Standard Java Thread Scheduling RTSJ requires a base scheduler that provides Preemptive and priority based execution A minimum of 28 unique priorities Define classes for execution eligibility and schedule feasibility 16/10/06 CSE 666 - Fall 2006 7 Enhancements to Standard Java Memory Management Garbage collection in standard Java is unsuitable for real-time threads RTSJ introduces the concept of memory areas memory – Standard Java heap Immortal memory – Shared among threads Scoped memory – For objects with a welldefined lifetime Heap 16/10/06 CSE 666 - Fall 2006 8 Enhancements to Standard Java – Thread synchronization Priority queuing on synchronized blocks Implementation of Java keyword Synchronized includes algorithm for priority inversion Wait free queues 16/10/06 CSE 666 - Fall 2006 9 Enhancements to Standard Java – Asynchronous event handling Real time application must respond to asynchronous real world events RTSJ includes Asynchronous events Asynchronous event handlers 16/10/06 CSE 666 - Fall 2006 10 Enhancements to Standard Java – Asynchronous thread termination Drastic and asynchronous changes in the real world may require a java thread to safely transfer its control and terminate RTSJ includes thread interruption with Asynchronous Transfer of Control (ATC) thread handlers 16/10/06 CSE 666 - Fall 2006 11 Enhancements to Standard Java – Physical memory address RTSJ includes direct access to physical memory A class that allows programmers byte level access to physical memory A class that allows creation of objects in physical memory 16/10/06 CSE 666 - Fall 2006 12 Concluding notes Java’s main problem for use in real time applications is unsuitable memory management RTSJ originated from the desire to use Java in real time applications Real time Java is emerging 16/10/06 CSE 666 - Fall 2006 13 References http://www.rtsj.org http://www.itl.nist.gov/div897/ctg/real-time http://www.developer.com/java http://www.cs.cmu.edu/~nbeckman 16/10/06 CSE 666 - Fall 2006 14 Thank You