Re: Should I cache LoadLibrary results?
Alexander Belchenko <[email protected]>
| Newsgroups | gmane.comp.python.ctypes |
|---|---|
| Message-ID | <[email protected]> |
Martin (gzlist) пишет: > On 03/05/2010, Alexander Belchenko <[email protected]> wrote: >> Question itself: does ctypes do any sort of caching of cdll.LoadLibrary >> results (for successfully loaded libraries) or should I care about not >> loading the library several times? > > Using `ctypes.cdll.foo` or `ctypes.cdll['foo']` will cache a > successful dlopen, but `ctypes.cdll.LoadLibrary('foo')` will not, see > the LibraryLoader code: > > <http://svn.python.org/view/python/branches/release25-maint/Lib/ctypes/__init__.py?&view=markup#LibraryLoader> If I understand the code correctly only `ctypes.cdll.foo` is caching one. Thanks, for the info. > > Martin > > > -- All the dude wanted was his rug back ------------------------------------------------------------------------------ _______________________________________________ ctypes-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ctypes-users