CPU Affinity Step

TestStand 2019 Help

Edition Date: May 2019

Part Number: 370052AA-01

»View Product Info
Download Help (Windows Only)

Use a CPU Affinity step to adjust the CPU affinity of a process or thread to allow the process or thread to run on a given set of CPUs on the computer.

You can also use the Default CPU Affinity For Threads option on the Preferences tab of the Station Options dialog box to determine which CPUs the user interface thread uses and the default CPUs for new executions. Use the Sequence Call Advanced Settings window in the TestStand Sequence Editor or the Thread Settings dialog box or Execution Settings dialog box in a TestStand User Interface to set which CPUs to use when executing a sequence in a new thread or execution.

Configuring the Step

Use the CPU Affinity Settings edit tab in the sequence editor and the CPU Affinity Step Configuration dialog box in a user interface to configure the CPU Affinity step.

Step Properties

In addition to the common custom properties, the CPU Affinity step type defines the following step properties:

  • Step.Operation—A value that specifies the operation for the step to perform. The valid values are 0 = Get System CPU Affinity, 1 = Get Process CPU Affinity, 2 = Set Process CPU Affinity, 3 = Get Thread CPU Affinity, and 4 = Set Thread CPU Affinity.
  • Step.Expr—An expression value that specifies or stores the CPU affinity for the system, process, or thread. For a Get operation, the expression specifies a variable in which to store the value. For a Set operation, the expression specifies a CPU affinity value. The CPU affinity is a numeric value where each bit represents a CPU. The lowest-order bit represents the first CPU. For example, a value of 12 (0b1100) represents CPUs 3 and 4 on a quad-core system.

See Also

CPU Affinity Step Type Support for 64-bit TestStand

Synchronization Step Types

Using TestStand on SMP Systems


Not Helpful