Samples

Example 14-1 demonstrates creation of a NoHeapRealtimeThread that is rooted in immortal memory.

It is probably possible to create a NoHeapRealtimeThread in a non-real-time thread, but it will be painful. The NoHeapRealtimeThread object and all the objects it references have to be allocated in non-heap memory. You can allocate in non-heap memory from a regular thread, but NoHeapRealtimeThread has a no-arg constructor, so you need to use the long form of newInstance that uses the reflection classes. The code is much easier to write if you enter the scope you want to use, but you have to be in a real-time thread to use enter.

The NoHeapRealtimeThread object will be constructed in the memory area in which the constructor is called. It will ...

Get Real-Time Java™ Platform Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.