Inline Mode
Programs that receive time-sensitive messages can use inline mode to favor low latency over high throughput. Inline mode reduces inbound message latency by consolidating transport I/O and message callback processing into one thread.
Before using inline mode, you must understand thoroughly understand the important details in this topic and the topics that follow.
Background
The term inline mode refers to the execution thread of the six phases of message delivery (see Inbound Message Delivery).
In regular operation the first three phases are separate from the last three phases. That is, the receive, match, and distribute phases occur in an internal receive thread, separate from program code. Meanwhile, the dispatch, process, and release phases occur in a dispatch thread, starting with a dispatch API call within application program code. The event queue is a loose coupling between these two triplets of phases: namely, the receive and dispatch pipelines.
In contrast, inline mode co-locates all six phases in the same thread. That is, the entire phase stack operates as a single I/O pipeline from the underlying transport, through the application program’s dispatch call, to message processing and release. All six phases occur within one program thread, at the application’s dispatch call. This tactical optimization eliminates a source of latency, namely, context-switching overhead between the distribute and dispatch phases. However, this tight coupling introduces several restrictions and potential pitfalls, which become the responsibility of the application programmer.
- Callback Restrictions with Inline Mode
Inline mode requires that callbacks always return quickly. Otherwise, long callbacks could delay message I/O, which would defeat the purpose of inline mode. - Transport Restrictions with Inline Mode
Inline mode restricts underlying transports. Read this entire topic carefully to ensure proper conformance with the restriction.