Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Overview

FIX Antenna HFT provides

...

the ability to configure CPU affinity programmatically.

Configuration

On initialization, each thread goes to the

...

Engine::ThreadsPoolListener::onNewThreadCreated(ThreadAttrs& threadAttrs) callback, where the user is able to define

...

the affinity for the thread. If the user doesn't specify the affinity for the thread,

...

all CPUs will be used.

Affinity is specified as

...

a bitmask where the serial number of the bit

...

is the serial number of the core if read from the right to the left.

...

The mask should be

...

presented in the decimal system.

Info

E.g.  to to specify the second, third, and fourth cores, the affinity in bytes will look like "like '1110"'. It is "14" in is '14' in the decimal system. So, for proper use, the affinity should be set to '14'.

In order Engine

...

to know exactly what code to call, the user should register on the mentioned callback on HFT Antenna start. Below is

...

the snippet from the

...

'Router' sample for reference:

Code Block
languagecpp
Engine::FixEngine::InitParameters params;
params.threadPoolListener_ = listener;
FixEngine::init( params );
Noteinfo

The way described above works for all the threads except the async logger thread.

Аsync logger thread affinity is configured in a different way by means

...

of g_platformProps.logger_CPUMask, which is the parameter of the platformProps global settings

...

object.

...

Below is

...

the snippet from the

...

'Router' sample for reference:

Code Block
languagecpp
g_platformProps.logger_CPUMask = mask;
platform_initialize(...);
launch_logger_thread();