02-20-2012 11:37 PM
Does break on step failure suspends the execution of the threads also?
I launched one thread (T1) from main sequence. I also have another sequence file called in the main sequence as sequece call which launches another thread (T2). After T1 and T2 are launched a step in the main sequence failed. It appears that while the control is waiting on failed step it suspended the execution of the threads also, is this the expected behavior of Break on step failure?
02-20-2012 11:56 PM
Yes, in order for a break event to occur (for any reason, not just break on failure), all threads within an execution must be suspended (or marked as externally suspended inside of a code module using the Thread.ExternallySuspended API). This is similar to how, when you are debugging a process with visual studio, all threads within that process are suspended when you hit a breakpoint. If you don't want this behavior, you should consider using the "New Execution" option on the sequence calls rather than "New Thread".
Hope this helps,
-Doug
02-22-2012 06:13 PM
Thanks Doug, I got some success but when using New Execution but I keep getting Microsoft R6025 - virtual function error and Object leaks.
The attached sequence files can be used to replicate the issue.
Steps to replicate:
1. Create a StationGlobals "Program_End" as boolean.
2. Create a StationGlobals "DiodeThread" as object reference.
3. Under Edit>>SequenceFileProperties I have "Separate File Globals for each execution" set
4. Run in Single pass
5. Close TestStand and Microsoft R6025 - virtual function error is reported followed by Object leak or Microsoft Kill TestStand window.
Now if the subsequence call NewExecution2 is commented then after executing and closing teststand Microsoft run time error is not reported. The Wait for execution will return error but I am not sure how to check is object reference does not exist and skip the Wait function pragmatically.
Just to summarize the error seems to be reporting when I have:
Main sequence file (new execution example4-1.seq) call another sequence file(NewSequenceFile.seq) which calls another sequence file(NewExecutionTwo.seq) and runs this (NewExecutionTwo.seq) sequence file as New Execution.
I am uing TS4.1.
02-22-2012 08:34 PM
02-23-2012 05:17 PM
Thanks for the reply Doug,
Could you please explain further on " I recommend creating all properties under globals that you will need in your first thread before any other thread is launched, or you will need to use a lock whenever accessing or modifying the globals. "
Not sure what is meant by "creating all properties under globals"
Here is what I am doing:
1. I define the StationGlobals as object reference type in the StationGlobals.ini file.
2. Main sequence file calls another sequence file which then has a subsequence step call set to new execution. In the advance setting of execution the stationglobal object reference is used.
3. Lastly in the main sequence file the Wait on execution step is using the stationglobal.
I tried placing a lock around Wait on execution step but that still seems to be generating object leaks. In other words not sure where the lock can be placed.
Thanks again for your suggestion.