TThreadAffinityMode Enumeration

Source: MtxForLoop.cs · Assembly: Dew.Math

public enum TThreadAffinityMode

Defines how the threads can be assigned to specific CPU cores.

Values

NameDescription
tamDefaultThreads are assigned to individual CPU cores by the OS.
tamSplit2Thread count is split half/half between CPU cores. Eight core example with two threads: Thread0: 11110000, can run on any of the first 4 cores. Thread1: 00001111, can run on any of the last 4 cores Eight core example with four threads: Thread0: 11110000 Thread1: 11110000, first two threads can run on any of the first four cores. Thread2: 00001111 Thread3: 00001111, Last two threads can run on any of the last four cores. Four core example with four threads: Thread0: 1100 Thread1: 1100, first two threads can run on any of the first four cores. Thread2: 0011, Thread3: 0011, Last two threads can run on any of the last four cores. Eight core example with eight threads: Thread0: 11110000 Thread1: 11110000 Thread2: 11110000 Thread3: 11110000 Thread4: 00001111 Thread5: 00001111 Thread6: 00001111 Thread7: 00001111 This setup is suitable for a two-way NUMA (two socket system) or a CPU with two memory channels. It gives the OS full control how to assign threads within each NUMA node, but threads cant be moved from one node to the other.
tamSplit4Thread count is split four ways between CPU cores. Eight core example with two threads: Thread0: 11110000, can run on any of the first 4 cores. Thread1: 00001111, can run on any of the last 4 cores Eight core example with four threads: Thread0: 11000000 Thread1: 00110000 Thread2: 00001100 Thread3: 00000011 This setup is suitable for: a four-way NUMA (four socket system) or a single CPU with four separate memory channels.
tamSplit8Thread count is split eight-ways between CPU cores. Eight core example with two threads: Thread0: 11110000, can run on any of the first 4 cores. Thread1: 00001111, can run on any of the last 4 cores The two threads always on distinct CPU cores, but in case of hyper-threading can land on the same physical cpu core. Eight core example with four threads: Thread0: 11000000 Thread1: 00110000 Thread1: 00001100 Thread3: 00000011 Eight core example with eight threads: Thread0: 10000000 Thread1: 01000000 Thread2: 00100000 Thread3: 00010000 Thread4: 00001000 Thread5: 00000100 Thread6: 00000010 Thread7: 00000001