Polling for Data
The TIBCO FTL library polls for available data during two phases of inbound message delivery:
- In the receive phase, it polls to receive data from a transport’s data source.
- In the dispatch phase, it polls to take messages from an event queue.
The paradigm is identical in both polling phases:
- Determine the time limit for polling, that is, the receive spin limit.
- Poll for available data.
- When the time limit elapses, block until data becomes available. Blocking relinquishes the CPU resource to do other work.
Threads and Latency
Polling code operates within a thread.
- If the thread is already executing on a CPU core and polling for data, then when data becomes available, the thread immediately gets the data, without adding latency.
- However, if the thread has blocked, the context switching time until it resumes execution adds to message latency. If it is crucial that your application minimize latency, then consider avoiding this situation by adjusting receive spin limit.
Next topic: Receive Spin Limit Tuning
Copyright © Cloud Software Group, Inc. All rights reserved.