OnixS C++ Tullett Prebon SURF Handler 1.6.1
Users' manual and API documentation
Loading...
Searching...
No Matches
Low Latency Best Practices

This section provides information about low latency best practices.

Disable Logging

Please use this code snippet to disable all logging operations:

// Available only log messages for fatal errors.
settings.logLevel = LogLevel::Fatal;
// Available only logging to file.
settings.logSettings = LogSettings::TraceToFile;

CPU Affinity Mask

Please use this code snippet to set processor affinity mask for receiving thread.

// TCP receiver will run on 2nd processor core
settings.cpuIndex = 1;

Spin-wait Mode

In software engineering, busy-waiting or spinning is a technique in which a process repeatedly checks to see if a condition is true, such as whether keyboard input is available, or if a lock is available. Spinning can also be used to generate an arbitrary time delay, a technique that was necessary on systems that lacked a method of waiting a specific length of time. On modern computers with widely differing processor speeds, spinning as a time delay technique often produces unpredictable results unless code is implemented to determine how quickly the processor can execute a "do nothing" loop.

Spinning timeout can be used for avoiding to enter a kernel mode of the operating system for some time.

Please use this code snippet to set spinning timeout:

// Timeout value in microseconds used for spinning
// before enter a kernel mode of the operating system.
settings.receiveSpinningTimeoutInMicroseconds = 1000;