python - dll access (ctypes or swig)

Alex Martelli aleax at mac.com
Wed Apr 18 10:40:14 EDT 2007


Larry Bates <larry.bates at websafe.com> wrote:
   ...
> I guess I was the only one it wasn't "obvious" to <grin>.  I've always
> written my COM servers as .EXE files even though they cannot be run
> independently.  What I find is "odd" is that I can create a .DLL or an
> .EXE of my COM server and after I register it, my application doesn't
> appear to know the difference.  The difference seems to be hidden from
> the actual application and doesn't affect it (at least that I can
> determine).

Yes, except for performance (a DLL affords within-process communication
without the overhead of IPC, so it can be much faster when appropriate)
and some technical issues such as threading (if COM client and server
are in separate processes, their threading models are independent from
each other; if they are in the same process, they'd better have
compatible threading approaches -- a thread-unsafe DLL server can make a
single-threaded client happy but would cause problems and crashes if a
freely-threaded client tried using it).


Alex



More information about the Python-list mailing list