Java and LXRT/COMEDI

Jan Kiszka kiszka at rts.uni-hannover.de
Thu Oct 28 19:25:34 CEST 2004


Kenneth Jacker wrote:
> ...
> It appears that the LXRT/Java approach would require me and my
> students to write Java-callable routines in C for the actual, time-
> critical RT code.  These "methods" themselves would invoke
> rt_make_hard_real_time(), rt_make_soft_real_time(), etc., and have to
> be written following the JNI (Java Native Interface).
> 

Without knowing precisely the potential interactions of both approaches 
on LXRT, you should avoid JNI when possible and use the CNI interface of 
the gcj instead. It is a much more sane approach to map native methodes 
on C++, what CNI provides, than on C like JNI does. And doing C++ with 
LXRT is not a big deal compared to kernel space.

> Compared to using the multiple thread/kernel modules approach
> described above, this would be a *lot* of work (unless someone else
> has already done it) and require learning JNI.  Also, I'm not sure
> there wouldn't be problems (scheduling, timing, etc) with the JNI
> "RT methods" interacting with the Java virtual machine.
> 
> 
> Have others used LXRT, COMEDI and Java *without* kernel modules?
> 

One or two of our students once more or less "played" a bit with the gcj 
and its classpath library over LXRT. I also has some experimental code 
somewhere, almost 3 years old now. It worked fine. Furthermore, with the 
gcj, you can at least overcome the interpreted model of Java and produce 
quite efficient native code! However, two main problems remained: 
garbage collection and the classpath library size (7 MB or so, of course 
only relevant on embedded systems).

I'm not up-to-date if you can now configure the size more freely. What I 
know is that there is an interesting project called jRate now which aims 
to implement the RTSJ (Real-Time specification for Java) with its 
real-time memory models replacing that problematic GC.

A colleague of mine is doing much more in this domain, I can ask him 
tomorrow for some comments on this. I think he is even supervising a 
student evaluating the jRate library right now.

Jan




More information about the Rtai mailing list