LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Thread Safe Queue Between DLL and EXE

Solved!
Go to solution

Hello,

 

We wondered if this architecture would work:

 

An exe would create a thread safe queue.   A dll routine would write to the queue using CmtWriteTSQData.   The exe in turn would have an installed callback for the queue for when there are a certain number of items in the queue.

 

The exe is linked to DLL.

 

Thank you,

0 Kudos
Message 1 of 5
(4,870 Views)

Hi jharris66, 

 

It sounds like that architecture you suggest should work. However I am not sure what you mean when you say the exe is linked to the DLL. Could you clarify what you mean when you say that?

 

Thank you! 

Rachel M.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(4,826 Views)

I basically meant that the exe implicitly links to DLL using *.lib.

 

I think the architecture appears to be working after some experiments. My main concern initally was whether the thread-safe queue would reside in memory that could be accessed by both DLL and exe.

 

Thanks,

Message 3 of 5
(4,801 Views)
Solution
Accepted by topic author jharris66

Unless you talk about ActiveX or .Net DLLs (or LabVIEW created DLLs) where there are possible exceptions, any DLL loaded by an application is loaded into the process space of the loading application. As such it uses the heap of the calling application.

Rolf Kalbermatter
My Blog
Message 4 of 5
(4,790 Views)

Thanks.  It is our own custom CVI DLL and not ActiveX or .NET. 

0 Kudos
Message 5 of 5
(4,779 Views)