‎04-28-2008 09:58 AM
‎04-28-2008 10:02 AM
I beleive the bottom line aswer to your Q depends on the DLL and how you have configured your dll call.
If the dll is thread-safe
AND
the call is configure to NOT run in the UI thread (yellow not orange)
THEN you should be able to make two simultaneous calls
I hope that helps,
Ben
‎04-28-2008 12:39 PM
Ben, you should note that these are different processes calling a LV DLL, not calls from within LabVIEW.
Cybertazer, different LV instances definitely have separate memory spaces, even if they call the same VIs. I assume this should be the same with calling a DLL (Windows probably loads a new instance of the RTE to run the DLL), but you can do a simple check by creating a simple LV2-style global in the DLL and calling it twice. For example, it can simply increment a counter. If both processes load into the same memory space, you will see it immediately, but I doubt that's the case.
‎04-28-2008 12:51 PM
I understand that the memory spaces are supposed to be completly seperate. The question is that if 2 processes call the same function in the same dll at the same time... will one process have to wait on the other process to finish before being allowed to execute? My feeling on this is no, it would not have to wait, but I am hoping that someone out there has a more difinitive answer.
There is no shared memory mechanisms set up in this vi.. ie for persistant data between execution processes. I am not even sure if this is possible with LV dll's, but I thought I would throw that in there since I know it is possible in general.
Thanks again for your help guys... keep em comming. Hopefully this will help clear up other peoples perceptions on how dll execution is handled in LV if we can nail this down a bit more.
‎04-28-2008 01:27 PM
I don't have any experience with LV DLLs, but the way I understand it, they are supposed to behave the same as executables and executables do load the VIs into memory, so that running a VI in one instance is completely separate from the other instance. That allows you to run the same VI at the same time from two different processes.
If you want to test this, place a long wait (e.g. 10 seconds) inside the VI in question and then call it twice. By seeing when the second call ends you will have an answer. As I said, I'm guessing they will be loaded into two separate RTE instances and so will run concurrently.