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)