Thursday, 21 May 2009

How real-time is javax.realtime?

The Java real-time specification - at last! Real-time brought to Java. But how real-time is real-time? How is the garbage collector tamed?

Hype warning: "javax.realtime (pronounced JARVAX-DOT-REALTIME) ...the one, the ONLY incredible javax base package you will need for all your real time Java needs!"

Let us try to prove or disprove the HYPE-othesis.

The class RealtimeThread extends Thread and adds various real-time services. The thread can be created using a SchedulingParameters object. NoHeapRealtimeThread is a specialization of RealtimeThread.

An instance of NoHeapRealtimeThread (NHRTT) may immediately preempt any implemented garbage collector, logic in its run() is NEVER allowed to allocate or reference any object allocated in the heap. Byte-code-wise, it is illegal for a reference to a heap-alloc'ed object to manifest in the operand stack for the NHRTT.

The JamaicaVM is an implementation of RTSJ. It provides hard real-time guarantees for all primitive Java operations, as well as hard realtime garbage collector. It runs on Linux, Windows and Solaris and various OS's including VxWorks.

No comments: