Page tree

Versions Compared

Key

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

...

On initialization each thread goes to the callback Enginecallback Engine::ThreadsPoolListener::onNewThreadCreated(ThreadAttrs& threadAttrs), where user is able to define the affinity for the thread. If user doesn't specify the affinity for thread, all CPUs will be used.

Affinity is specified as a bit mask where serial number of the bit is serial number of the core if read from the right to the left. Mask should be presented in presented in the decimal system.

...

Info

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

In order Engine knows exactly what code to call, user should register on the mentioned callback on HFT Antenna start. Below is the snippet from the "Router" sample for reference:Snippet from the "Router" sample

Icon



Note

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


Аsync logger thread affinity is configured in a different way by means of g_platformProps.logger_CPUMask, which is parameter of the global settings object platformProps. Below is the snippet from the "Router" sample for reference:

...