I have multiple threads running - I only want the first one turning a certain device on and the rest of them just skipping this sub-sequence.
Rather than designing a system of flags - I was hoping there is a way to rig syncronization behavior similar to the batch synchronization option of "one thread only"?
Is there a way to have all the sequence by pass the step at the end that turns this device off and the last one executing the turn off?
Solved! Go to Solution.
Batch Synchronization Step Types will only work when using the Batch Process Model (without additional implementation on your part to synchronize the threads executing in the Parallel Process Model).
TestStand offers the Batch Specification step to define a group of threads; enabling you to perform Batch Synchronization in a non-Batch Process Model. Refer to the attached Sequence File for a reference to an implementation using Batch Specification steps.
Move it to the ProcessSetup and ProcessCleanup callbacks. That way it will only occur once because these happen before and after the threading.
If you cannot move it to those callbacks then I would recommend you use the batch model. Synchronizing the parallel model for this purpose within the threading voids the purpose of the parallel model. At that point you may as well do the batch.
Hope this helps,
may be I jumped the gun - with what you are suggesting all threads still go into the sequence, only doing it 1 by 1....I need the first one to go in, and the rest to skip.
Neither one is feasible for me:
I can't touch the process model - because this will alter the behaviour of the rest of the tests
I can't change the process model for the same reason as above.
In that case, just put the SequenceCall step inside the Batch Synchronization section (see attached image for an example).
That is exactly what I am doing - what I am observing is one thread enters the batch - executes, other one waits, than also enters the batch and executes - what you gave me works like a lock functionality.
Even if you run the example you have given me - you can run each SN through your batch, while the goal is to execute the first one that comes in and bypass all others