Marek...
The number of threads that TestStand can run is not the problem I believe.
I have DLL's that launch many threads that continue to run even after Teststand sequence execution has completed. I don't believe there is an issue with repect to this and TestStand.
It maybe as something as simple as the LOAD property for that step being set to unload as soon as step finishes.
In this example, the Step calls the DLL which executes new threads, but since it returns before those threads execute, the sequence unloads the DLL (or tries to). Since the threads are still running, they may try to access memory no longer under control of the teststand process.
In fact, I am sure this is your problem. You would not see this when in a developement envir
onment outside of teststand.
Have a look at the step properties or the sequence properties, and try setting (or verify), the step type is set to load on Sequence Load, and Unload on sequence unload.
If you sequence is dynamically loaded and unloaded, you may have to play around with that a bit more.
I am still convinced that your 'threads' are running when the DLL has been unloaded, or similar.
Try the above, and let me know how you get on, or if you need a better description, I can go look at TestStand and give you better directions.
Chris