Showing results for 
Search instead for 
Did you mean: 

Multithreading with .dll



I've got a 2-dimentional Array that I pass to a .dll to evaluate it. The .dll doesn't modify the 2-dim Array. It goes through all the elements and sorts them into a 1-dim Array, according to some parameters. Both Arrays are passed as Pointers.


Now I wonder: Can I accelerate this process by multithreading? My Idea is to pass the Pointers of the Arrays to 2 .dll simultaniously. Both .dll would then only have to go through half the Array.

However they would need to access the same Arrays. This isn't a problem with the 2-dim Array, since the 2 .dll would access different Values of the Array. Or is that still a problem?

I think there would certainly be a problem with the 1-dim Array, since both .dll would access the same values at the same time. Or does Labview block this automatically? So nothing can go wrong?

Does LabView allow 2 .dll that use the same set of data at all?


Or is there some better way to use multithreading in this case? Like inside the .dll?


Thanks for your ideas.


0 Kudos
Message 1 of 3

Regardless if LabVIEW can access the same dll in two threads, I don't think it will work.  Since both threads are working on the same array, they would need to coordinate to produce on complete 1-D array. 


Could you split the 2D array into two parts, run the two threads, take the 2, 1-D array results and then combine them?



"There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
0 Kudos
Message 2 of 3


thanks for your reply!


I think I could do 2 1-D Arrays and add them in the end. Thanks for the idea!

However that still leaves the question, wether LabView can run the same .dll on seperate threads and wether the same 2-D Array can be accessed by 2 functions in different threads at the same time?


Especially the "running the same .dll in seperate threads" part is very important for me, as I will probably try to run the same function in the .dll on 4 threads.

I read something about former LabView -Versions that could only run 2 dll-nodes simultaniously, and I read something that I interpreted as "You need to specially configure your .ddl-node so it isn't executed in the UI-Thread.

I am really getting confused. Does anybody know the facts?


Thanks a lot again!


0 Kudos
Message 3 of 3