The Batch process model creates a controller execution and an execution for each test socket. When performing certain operations, the batch model synchronizes the controller and test socket executions at various synchronization points to ensure exclusive access to shared resources and data.

If you create a model plug-in that performs operations in the Batch Start and Batch Done controller entry points that must synchronize with operations in the UUT Start and UUT Done test socket entry points, you can call methods of the ControllerAndSocketSynchronizationManager class of ManagedModelSupport.dll, located in the <TestStand>\Components\Models\TestStandModels\ManagedModelSupport directory, from the controller thread or the test socket thread, as described in the following table.

Method Called From
WaitForTestSockets Controller thread
SyncWithController Test socket thread
AllowTestSocketsToContinue Controller thread

You can use the class to implement controller and test socket synchronization in which the sockets either to release them or to release them.

Test Sockets Wait for the Controller to Release the Sockets

The controller thread calls the WaitForTestSockets method, which waits until all test sockets reach a corresponding call to the SyncWithController method, which then waits until the controller executes a corresponding call to the AllowTestSocketsToContinue method, as shown in the following figure.

This synchronization implementation requires the following functionality:

  • The controller passes True to the socketsWaitForController parameter of the WaitForTestSockets method.
  • The test sockets pass True to the waitForController parameter of the SyncWithController method.
  • The controller executes a corresponding call to the AllowTestSocketsToContinue method.

Test Sockets Do Not Wait for the Controller to Release the Sockets

The controller thread calls the WaitForTestSockets method, which waits until all test sockets reach a corresponding call to the SyncWithController method. The test sockets immediately continue execution after calling the SyncWithController method. The controller does not execute a corresponding call to the AllowTestSocketsToContinue method, as shown in the following figure.

This synchronization implementation requires the following functionality:

  • The controller passes False to the socketsWaitForController parameter of the WaitForTestSockets method.
  • The test sockets pass False to the waitForController parameter of the SyncWithController method.
  • The controller must not execute a corresponding call to the AllowTestSocketsToContinue method.