Synchronization Step Types - Rendezvous and Semaphore
- Updated2025-07-23
- 2 minute(s) read
Purpose
This example demonstrates how to use the Rendezvous and Semaphore synchronization steps to control multi-threaded execution flow between threads or across executions in a sequence file that uses the Batch process model.
- A Rendezvous step will make a set number of threads wait until all threads specified are at the same point and ready to proceed. Unlike batch synchronization, rendezvous steps can be used to synchronize any TestStand threads or executions, without requiring the batch process model.
- A Semaphore step is similar to the Lock step in functionality, except that you can specify any number of threads instead of just one.
Example File Location
<TestStand Public>\Examples\Built-In Step Types\Synchronization Step Types\Synchronization Step Types - Rendezvous & Semaphore.seq
Highlighted Features
- Batch process model
- Rendezvous step type
- Semaphore step type
Major API
None
Prerequisites
None
How to Use This Example
This example uses the Rendezvous or Semaphore steps to synchronize four test sockets in a batch test.
Complete the following steps to review the sequence functionality.
- Select Edit»Sequence File Properties to launch the Sequence File Properties dialog box. On the Advanced tab, the Model File control specifies the Batch process model, which will run the test sequence in multiple parallel executions (test sockets).
- On the Sequences pane, select the MainSequence.
- Complete the following steps to review the steps in the MainSequence.
- Select the Create Semaphore 1 step. On the Semaphore Settings edit tab, notice that the Create operation is selected. This step creates a new semaphore named "Semaphore 1". The Initial Semaphore Count control specifies a value of 2, which indicates that two test sockets can execute the semaphore section at any given time. The Acquire Semaphore 1 step and Release Semaphore 1 step represent the start and end of the semaphore section.
- Select the Create Rendezvous 1 step. On the Rendezvous Settings edit tab, notice that the Create operation is selected. This step creates a new rendezvous named "Rendezvous 1". The Number of Threads per Rendezvous control specifies a value of 4, which indicates that when one test socket reaches the Start Rendezvous step, the socket waits for the other three sockets before continuing execution.
Complete the following steps to run this example.
- Select Execute»Single Pass to run the sequence. TestStand creates four test sockets, and each test socket executes the MainSequence. When the executions reach the Acquire Semaphore 1 step, two test sockets enter the semaphore section and the remaining two sockets wait. When the first two test sockets execute the Release Semaphore 1 step, the remaining two test sockets enter the semaphore section. When the test sockets reach the Rendezvous step, the test sockets wait until all test sockets reach the step before execution continues.