New Thread - Sequence Call Advanced Settings Window
- Aktualisiert2025-07-21
- 3 Minute(n) Lesezeit
New Thread - Sequence Call Advanced Settings Window
New Thread
The Sequence Call Advanced Settings window contains the following options when you select Use New Thread in the Execution Options control on the Module tab:
- Automatically Wait for the Thread to Complete at the End of the Current Sequence —When you enable this option, the calling sequence waits for the thread it launches to complete before the calling sequence returns. TestStand propagates status and error information from the asynchronous thread call to the waiting sequence. However, TestStand does not add results for the asynchronous thread call to the results of the waiting sequence. Disable this option and use a Wait step if you want to obtain the results and control whether TestStand copies status and error information from the asynchronous thread call to the Wait step.
-
Initially Suspended
—When you enable this option, TestStand creates the new thread in a suspended state. Call the
Thread.Resume
method in the TestStand API to start the thread.
Note If you select Resume in the Debug menu of the TestStand Sequence Editor , TestStand does not resume an initially suspended thread.
-
Use Single-Threaded Apartment
—Specifies whether the concurrency model of the thread is initialized as single-threaded apartment (STA) or multi-threaded apartment (MTA). By default, TestStand initializes new executions and threads to use the multi-threaded apartment model. A thread must use the single-threaded apartment model if the thread creates or launches a dialog box that contains ActiveX controls.
If you use this option to launch a sequence that contains a step that displays an ActiveX control, you may need to set the Load Option in the Run Options panel of the Step Settings pane to Load Dynamically. This ensures that TestStand loads the module the step calls in the thread initialized as STA.
- Store an Object Reference to the New Thread in (optional) —Stores a reference to the new Thread object in the object reference variable you specify. You can use this reference in subsequent calls to the TestStand API. You can also use this reference in a Wait step to wait for the thread to complete.
-
CPU Affinity for New Thread
—The CPUs on which the new thread executes. The ring control contains the following options:
- Use Station Option for CPU Affinity —TestStand uses the Default CPU Affinity For Threads station option on the Preferences tab of the Station Options dialog box as the CPU affinity of the new thread.
- Use CPU Affinity of Caller —TestStand uses the CPU affinity of the calling sequence as the CPU affinity of the new thread.
- Use All CPUs —TestStand uses all CPUs available to the process as the CPU affinity of the new thread.
- Use Custom CPU Affinity —TestStand determines the CPU affinity of the new thread using an expression that evaluates to a numeric value, where each bit represents a CPU. The lowest order bit represents the first CPU. For example, a value of 12 ( 1100 ) represents CPUs 3 and 4 on a quad-core computer. A value of -1 represents all CPUs available to the process.