Recycling Async Event Handlers

An async event handler is similar to a thread. Ideally, it will be a lighter-weight construct than a thread, so recycling it should generally be unnecessary unless the system moves through multiple phases each of which uses a separate large collection of async event handlers.

A reusable async event handler is surprisingly different from a reusable thread. The fundamental difference is that the JVM executes the run method of a thread once, but the RTSJ executes the handleAsyncEvent method of an async event handler repeatedly. (Or, if the async event handler was constructed with a logic parameter, it will call the run method of that object repeatedly.) It does not have a join method or a start method and turns out ...

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.