We have an issue with having multiple mex and dll files, which have similarly named, differing versions of the same dlls.
They are kept on separate paths, with their own copies the dlls. We have previously had to call 'clear mex' to force matlab to unload old versions of mex files before we can load up the next.
We would like to be able to maintain state in the dll's (specifically to avoid long and expensive operations to move data between matlab and the DLLs) and are hoping to use loadlibrary to allow us to do this.
Unfortunately this means our 'clear mex' hack, no longer works. Could you explain possible methods to allow us to load multiple DLL's, which depend on different versions of identically named DLLs?

 Réponse acceptée

the cyclist
the cyclist le 22 Oct 2018
Modifié(e) : the cyclist le 22 Oct 2018

0 votes

I think your question would be answered by a careful reading of this documentation page about function precedence order. Or at least it will tell you the confines within which your are operating.
If not, maybe giving a specific example of function location and calling attempts would be helpful?

1 commentaire

William Thorley
William Thorley le 22 Oct 2018
Sorry, if I wasn't clear, let me clarify with an example:
I have a mex file and a dll:
The first:
  1. mex file readData_mex.mex
  2. at the location MATLAB_WORKING_DIRECTORY/Mexfile1/.
  3. It has a dependancy on a dll DataUtilityFunctions.dll.
The Second:
  1. dll file processData.dll.
  2. at the location *MATLAB_WORKING_DIRECTORY/DifferentMexFiles/*.
  3. It has a dependancy on a dll DataUtilityFunctions.dll.
MATLAB_WORKING_DIRECTORY/DifferentMexFiles/DataUtilityFunctions.dll and MATLAB_WORKING_DIRECTORY/Mexfile1/DataUtilityFunctions.dll are different versions (major revision numbers) of the same DLL. This means they do not have identical interfaces and so cannot be used in place of each other.
each mex (or dll) file has been compiled and linked against it's appropriate version of DataUtilityFunctions.dll.
Which ever mex (or dll) file we try to run second will fail to load. Seemingly as it can't link against the version of DataUtilityFunctions.dll which is stored in matlabs memory.
If we run the mex. call 'clear mex' then run the dll, they also run fine.
However we desire to have both in MATLABs memory at the same time (to avoid having to repeatedly transfer, very large amounts of data over the DLL barrier (many millions of varying sized arrays, totaling roughly 15GB)
I guess the shortest question is: Is it impossible to have multiple differing instances of the same dependancy dll in MATLABs memory at once?

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

Produits

Version

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by