04-08-2011 08:58 AM
Using LabVIEW 8 RT.
Got a VI whose VI Properties, Execution category, set to normal priority and the preferred executions system set to same as caller.
it has a Call Library function node that is calling a function in a dll and it is set to Run in UI Thread.
when this vi is run, will there be a context switch? if so, should the dll function call be set to re-entrant? are the choices different in different versions of LabVIEW?
04-08-2011 09:17 AM
As i understand your description yes it will switch to the UI thread.
You can set it to run in other threads provided the dll is thread-safe. If the dll ws not written to be re-entrant, but you makr it as such, its only a mmter of time until youget a crash.
If the dll was not written to be re-entrant but is thread-safe then putting it a wrapper marked as non-re-entrant (the default unless you change it) should allow it being called from multiple places with concerns of two threads yanking on it at the same time.
Ben