NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

concurrency at process level

Does TestStand provide concurrency at the Win32 Process level?

I know there are provisions for executing threads within a single process, but I'm curious if it's possible to simultaneously run Win32 processes.

Thanks,

Menchar
0 Kudos
Message 1 of 5
(3,283 Views)
Hi Menchar,
 
I'm not sure I know exactly what you mean when you say concurrent?
 
If you are talking about multithreading then you can have different threads running at the same time.  If you are talking about two different executions then this is possible as well as evidenced in both the Parallel and Batch process models.  If you are talking about different instances of the Operator Interface then this is possible as well.  Just open two at the same time. 
 
In TestStand in order to have a thread you have to have an execution.  A thread is contained within an execution.  Every time you click Execute>>Single Pass or Execute>>Test UUTs then you are spawning a new execution.  Within this execution there is at least one thread. 
 
To call a sub sequence in a new thread or new execution then you simply right click the sequence call step and in the Specify Module dialog change the option Multithreading and Remote Execution to new execution or new thread. 
 
If you want to call a step in a new execution then just put it in a new sub sequence and call this sequence the same way. 
 
Let me know if I am even remotely close to what you are looking for.
 
Regards,
jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 5
(3,272 Views)
Threads in the same process are just as concurrent as threads in different processes. For example, they can be scheduled on different processors in both cases. The difference is that separate processes are isolated from each other, which can be good if there is a bug, but it can also make sharing data between threads in different processes slower or more awkward than between threads in the same process.
 
The TestStand engine can execute in more than one process and the TestStand synchronization steps can synchronize and pass data between threads in the same process, different processes, or even different machines.
 
Whether or not you can launch more than one instance of a TestStand editor or operator interface application depends on whether the particular application was written to be multi-instance or single-instance.
 
In a sequence, you can use the Call Executable step to launch (and optionally wait on) another process. You can also directly start other processes by calling the Win32 sdk with the DLL adapter, or by calling a code module that starts another process.
 
You might also be able to call a subsequence in a separate process by specifying the call as a remote call, while passing the local machine as the destination. This is just a theory I have. I've never tried it.
0 Kudos
Message 3 of 5
(3,267 Views)
Sam -

Yes, this is what I was asking, thanks for the info.

I am quite familiar with Win32 processes and threads.

What I didn't know was exactly how Win32 processes and threads might be mapped onto the TestStand execution models.

I have a single threaded test process that is so poorly written that converting it to a multi-threaded process would be problematic.  But I want to test four widgets at the same time.

So what I'd like to do is have a single user interface, and then spawn multiple copies of the test process, and have the processes execute concurrently, each process testing a separate widget.  The processes would be parameterized to get the desired behavior. 

Menchar


0 Kudos
Message 4 of 5
(3,259 Views)
James -

Thanks for the info.  Yes, you can do RPC in Win32 (remote procedure call). 

Menchar
0 Kudos
Message 5 of 5
(3,257 Views)