Affinity Mask

Affinity Mask

An affinity mask is a bit mask indicating what processor(s) a thread or process should be run on by the scheduler of an operating system. Setting the affinity mask for certain processes running under Windows can be useful as there are several system processes that are restricted to the first CPU / Core. So, excluding the first CPU might lead to better application performance.

As  FSX runs on just one core, setting an Affinity Mask to use an additional core can give a significant increase in frame rates and allows faster loading of Tileproxy scenery. With my i5 I use AffinityMask=12 which needs to be added to the fsx.cfg file.

[JOBSCHEDULER]
AffinityMask=12

Windows Task Manager shows the Intel(R) Core(TM) i5-4670K CPU @ 3.40GHz with its 4 cores, 0, 1, 2 and 3.
I want to use two cores, 0 and 1, so referencing the cores in reverse order, the binary code will be 0011.

 Core 3 2 1 0
 Binary 0 0 1 1

Calculator binaryCores entered as binary in the calculator.

Calculator decimalChanging calculator to decimal shows 12 as the setting for the AffinityMask.

Windows Task ManagerWindows Task Manager with no AffinityMask overdrive setting, one core is in use and is fully loaded.

Windows Task ManagerTask Manager with AffinityMask=12 two cores are being used.

 

Windows Task ManagerTask Manager with AffinityMask=14 three cores are being used.

 

You can try this in real time with FSX running.

  • Start FSX and park at an airfield
  • Set frame rate to unlimited and display them
  • Start Windows Task Manager
  • Click the Performance tab
  • Under the View menu... CPU History... select One Graph Per CPU
  • Now go to the Processes tab
  • Under Image Name column locate fsx.exe *32
  • Right click on it and choose Set Affinity...
  • From here you can choose which cores you want to use
  • Now switch back to the Performance tab to see the effect on the cores
  • Look at FSX to see the effect on FPS

For information about using more than one CPU core in Tileproxy click here.

RELE0011