> Is it possible to ask LabVIEW to execute all subVI in a sigle thread
> on a dual CPU machine. Our SubVI are calling an API. And this API
> look for the TheadID to recognise which application is doing the call.
> We would like to get advantage of multiprocessing. But having all the
> SubVI call with the same ThreadID?
If you have more than one thread in an execution system, then any of
those threads can be used to execute the VI. In fact, if the code is in
a loop, one iteration of the loop can be run by one thread, and the next
iteration by another thread. It just depends on how the OS happens to
pick threads to execute.
You can setup different VIs to run in different execution systems.
Typically, you will leave most of the subVIs set to run Sam
e as Caller
to inherit the execution system and avoid unnecessary context switches.
You will then set just a few VIs to run in a specific execution system
to control situations like this.
Finally, the default setting will be for each execution system to have a
thread per CPU. You can change this in a couple ways. First off, the
User Interface execution system never has more than one thread. In
fact, there it is the initial thread of the application, and it is used
for all tasks that are unprotected and nonreentrant. A second approach
is to reconfigure one of the other execution systems to have a single
thread. You do this using the vi.lib/utility/threadcfg.llb tool. It
will show the current thread settings and allow them to be modified.
The tool will result in a number of settings being written to the .ini
file. You will want to take those settings with you if you build EXEs.
Greg McKaskle