Why does phidget21.dll require running in the UI thread?

Supporting Labview 2012 and up
altenbach
Phidgetsian
Posts: 6
Joined: Wed Jul 20, 2011 6:17 pm
Contact:

Why does phidget21.dll require running in the UI thread?

Postby altenbach » Fri Oct 21, 2011 5:41 pm

Looking at all the phidget drivers for LabVIEW, all "Call library function nodes" to phidget21.dll are configured to run in the UI thread.

There is probably not enough documentation on the dll for me to decide this, thus I am asking here:

Would it be safe to change this configuration and allow running it in any thread instead?

According to the LabVIEW help:
Run in any thread - Specifies that the Call Library Function Node execution continues on the current thread executing the VI. You must make sure that multiple threads can call the function simultaneously.

(Well, the manual says: "The Phidget Labview library contains only glue logic for interfacing with the C library, thus making maintenance much easier. It should be noted the library employs threading and events extensively." In other parts it is labeled as "robust", whatever that means. So, why force it to run in the UI thread?)

User avatar
Patrick
Lead Developer
Posts: 3091
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: Why does phidget21.dll require running in the UI thread?

Postby Patrick » Wed Oct 26, 2011 12:32 pm

The C library is thread safe, so you can safely change this option. I'm not sure why we decided to code it in this way, but the decision was probably arbitrary.

-Patirck

altenbach
Phidgetsian
Posts: 6
Joined: Wed Jul 20, 2011 6:17 pm
Contact:

Re: Why does phidget21.dll require running in the UI thread?

Postby altenbach » Thu Oct 27, 2011 12:23 pm

Thanks! I will change it and see if I run into any unexpected things. :D


Return to “Labview”

Who is online

Users browsing this forum: No registered users and 0 guests