Real-Time Java

December 20th, 2007

Here are my notes from a Java SIG meeting held at Google in NYC on December 19th 2007.
Presentation slides and demo code should become available at http://javasig.com/ shortly.

• Hard real-time vs. soft real-time distinction is not always obvious. A media player operates in soft real time even though timeframes are in milliseconds. A trade settlement is hard real-time even though timeframes are in days.
• The goal of a real-time developer is to control latencies. There are two main sources of unpredictable latencies – GC and JIT compiler. If latency spike is not due GC it is usually due to GIT.
• Temporal correctness conditions (TCC) is an acronym used to describe a set of issues related to proper execution of real-time programs.
• JSR-001 describes API set and semantics to allow developers to reason about time correctness but does not introduce any changes to the language.
• Some of the creators of Ada, which is often used for real time development, worked on JSR-001.
• According to the speaker BEA’s real time GC implementation in JRockit is not RTSJ compliant. It uses different approach – transparent for the developer. I think each approach works to a point but hard real-time systems with sub millisecond deadlines are better to be left to RTSJ or C++.
• Schedulable interface is a good point to start exploring the API.
• Periodicity allows developers to control the scheduler.
• Scoped and immortal memory outside of standard heap is used for real-time threads.
• Sun’s implementation runs on Solaris only. IBM’s version runs on Linux.
• RTI is a real-time data grid vendor – check it out.
• You can use Java concurrency library with RTSJ, for example you can use a thread pool to manage real time threads.

Open Questions:
• How do you implement real time systems in .NET? Are there any other options besides using unmanaged C++?

Comments are closed.