NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Log results from parallel thread without add Wait

Hi All,

we'd like to log and display the results of a sequence call (subsequence) where we use New Thread as execution option.

 

There is a solution for this situation, but in my understanding this makes the New Thread option useless:

https://forums.ni.com/t5/Example-Programs/Including-Results-of-Subsequence-Launched-in-New-Thread-in...

 

In this case we have to wait until the new thread is done, but this why we'd like to execute the subsequence in a new thread - we don't want to wait until it finish the execution.

 

Does anybody know a better solution?

 

Thx in advance!

MYki

0 Kudos
Message 1 of 2
(1,895 Views)

The idea behind that example is that you wait at the end of the calling sequence on the new thread, which still allows you to parallelize any steps that happen after the sequence called in a new thread. Here's an example:

Sequence.PNG

Execution Profile with new thread:

NewThread.PNG

Execution Profile without new thread:

Profile.PNG

This example decreases the total test time by about 20% by running "SubSequence" in its own thread while running "SubSequence_2" in the main thread.

 

If you'd like more detail on why exactly you need to wait at the end of the calling sequence to include the results from a new thread, I'd suggest reading through this white paper. The gist is that if the MainSequence finishes before the subsequence, the ResultList of the subsequence never makes its way into the ResultsList of the MainSequence, and  never get processed by the plug-ins.

 

Edit: It actually would reduce the time in this case by about 50% if i preloaded my modules in both cases Smiley Frustrated

 

Hope this helps!

Trent

https://www.linkedin.com/in/trentweaver
0 Kudos
Message 2 of 2
(1,850 Views)