LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

thread execution

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?

0 Kudos
Message 1 of 2
(1,967 Views)

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

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 2
(1,964 Views)