Synchronized Sections
- Updated2025-07-23
- 2 minute(s) read
Place a Batch Synchronization step at the beginning of a section of steps in a sequence and specify an Enter operation for the step. Place another Batch Synchronization step at the end of the section of steps and specify an Exit operation for the step. You must place the Enter and Exit steps in the same sequence file, but you do not have to place the Enter and Exit steps in the same step group.
Each thread in a batch that enters a synchronized section blocks at the Enter step until all the other threads in the batch arrive at their respective instances of the Enter step. A thread cannot re-enter a section it has already entered. Each thread in a batch that reaches the end of the synchronized section blocks at the Exit step until all the other threads in the batch arrive at their respective instances of the Exit step.
You can use the following types of synchronized sections in sequence files:
- Serial—Use a Serial section to ensure that each thread in the batch executes the steps in the section sequentially and in the order you specify when you create the batch. When all threads in a batch arrive at their respective instances of an Enter step for a Serial section, TestStand releases one thread at a time in ascending order according to the order numbers you assign to the threads when you use a Batch Specification step to add the threads to the batch. As each thread reaches the Exit step for the section, the next thread in the batch proceeds from the Enter step. After all the threads in the batch arrive at the Exit step, the threads exit the section together.
- Parallel—Use a Parallel section to run each thread independently. When all threads in a batch arrive at their respective instances of an Enter step for a Parallel section, TestStand releases all the threads at once. As each thread reaches the Exit step for the section, the thread blocks until all the threads in the batch reach the Exit step. After all the threads in the batch arrive at the Exit step, the threads exit the section together.
- One Thread Only—Use a One Thread Only section to specify that only one thread in the batch executes the steps in the section. Typically, you use this type of section to perform an operation that applies to the batch as a whole, such as raising the temperature in a test chamber. When all threads in a batch arrive at their respective instances of an Enter step for a One Thread Only section, TestStand releases only one thread. When that thread arrives at the Exit step for the section, all remaining threads in the batch jump from the Enter step to the Exit step, skipping the steps within the section. All the threads in the batch exit the section together.
Note For nested sections, TestStand ignores the inner section when the type of the outer section is set to One Thread Only.