Multiple library access problem

"Massi" <[email protected]>
Newsgroups gmane.comp.python.ctypes
Message-ID <[email protected]>
Hi everyone,

in my script I need to execute multiple separated loading of the same dll library, in order to handle the internal variables with different threads.
Consider the followin piece of code:

lib1 = cdll.LoadLibrary("MyLib.dll")) 
lib2 = cdll.LoadLibrary("MyLib.dll")) 

lib1.var1 = 0
lib2.var1 = 1

Now, if I print the value of lib1.var1 I get 1, that is lib1 and lib2 points to the same memory space. Is there a way to create "different instances" of the same library? Or, alternatively, does it exist any workaround to avoid lib1 and lib2 share the same memory space?

Thanks in advance.

------------------------------------------------------------------------------

_______________________________________________
ctypes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ctypes-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.