Real time Java is a catch-all term for a combination of technologies that allows programmers to write programs that meet the demands of Real time systems in the Java programming language.
Java's sophisticated memory management, native support for threading and concurrency, type safety, and relative simplicity have created a demand for its use in many domains. Unfortunately, several properties prevent it from being directly suitable for use in Real time systems:
- Java does not support a strict priority based threading model. Early suggestions that it support such a model were abandoned because they could not be implemented without native bindings on the target Windows and Solaris platforms.
- Because Java threads do not support priorities, Java locking mechanisms do not support priority inversion avoidance techniques, such as priority inheritance or the priority ceiling protocol.
- More critically, the garbage collection behavior may introduce unbounded delays in computation, immediately destroying any chance of making real-time guarantees for programs written in Java.
To overcome these difficulties, the Java Community introduced a specification for real-time Java, JSR001. As of 2006, a number of implementations of the resulting Real-Time Specification for Java (RTSJ) have emerged, including a reference implementation from Timesys, and Sun Microsystems's Java SE Real-Time System.
The RTSJ addresses the critical issues by mandating a minimum specification for the threading model (and allowing other models to be plugged into the VM) and by providing for areas of memory that are not subject to garbage collection, along with threads that are not preemptable by the garbage collector.
See also
- Javolution - Real-Time Java Library (open-source)
Peer comments
>>Because Java threads do not support priorities
I do not agree with this claim. Java threads do support priorities, only the priorities themselves are loosely enforced. That is, varying thread priorities may alter the per-thread throughput, but cannot be used as a guarantee of preferring the scheduling of one thread over another.
[Emil Koutanov]
External links
- Real-Time Specification for Java (RSTJ)
- JSR-1
- Sun Java SE Real-Time System
- Timesys RTSJ implementation and testing toolkit
- jRate (Java Real-Time Extension) an open-source extension of the GNU GCJ compiler front-end and runtime system which adds support for most of the features required by the RTSJ.
- JamaicaVM a Real-Time JVM
- International Workshop on Java Technologies for Real-time and Embedded Systems (JTRES)