Final Remarks

A no-heap thread is easy to use if you control object creation, but you can never relax. Any time the thread needs to create an object that it does not want to create forever, you must enter a scoped memory. Any time you want to create an object with a lifetime that is less than the lifetime of the thread but does not fit a scope, you must create a special-purpose allocator for that type of object. (See Chapter 16.)

Even creation of no-heap threads can force the programmer to think too hard. All the initial parameters of the thread have to be accessible in the thread. That means they have to be in immortal memory, in the scope of the thread object, or in a scope outside the scope of the thread object. If the thread object is immortal, ...

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.