Killing threads can leave the process in a bad state. An alternative that TestStand provides is a way for your code modules that run for a long time to more cooperatively execute within TestStand. If you pass the sequence context into such code modules you can use the SequenceContext.RunState.Thread.ExternallySuspended property SequenceContext.RunState.Execution.InitTerminationMonitor(), and SequenceContext.RunState.Execution.GetTerminationMonitorStatus() methods to improve the behavior of your code modules while running from a TestStand sequence.
The SequenceContext.RunState.Thread.ExternallySuspended property can be used to allow TestStand to show an execution as suspended even while your code module is still running.
The SequenceContext.RunState.Execution.InitTerminationMonitor(), and
SequenceContext.RunState.Execution.GetTerminationMonitorStatus() methods give your code module a way to monitor when TestStand needs them to abort so that they can return control back to TestStand.
Please see the online help for these APIs for more information. If you still have questions about this please let us know.
Hope this helps,
-Doug