Chapter 14. Non-Heap Access

The RTSJ defines a type of real-time thread that is not allowed to use objects in the heap. It cannot allocate them or touch them in any way. This is certainly an inconvenience, but it lets those threads behave as if there were no garbage collector. Most threads are delayed until the garbage collector gets to a clean point before they are allowed to interrupt it. A NoHeapRealtimeThread can preempt a thread that is in the garbage collector as quickly as it can preempt any other thread.

Some systems will find the strictly enforced ban on access to heap objects a convenient barrier between real-time and non-real-time threads, but for most applications, the discipline ...

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.