Free-threading, COM and Multiple CPU's

Mark Hammond mhammond at skippinet.com.au
Sat Mar 22 20:49:49 EST 2003


Engel, Gregory wrote:
> At the very end of Mark Hammond and Andy Robinson's excellent book,

Thanks!

> "Python Programming on Win32" they provide example code for creating
> free-threaded objects, demonstrating that COM spins up a new thread
> to host objects created by a main thread.  My question is, under
> these conditions would the free-threaded COM objects utilize the
> resources of multiple CPU's?  Unfortunately, I am not developing on a
> multiple CPU box yet may be required to deploy on a multiple CPU box.

In general, no.  Only one processor can ever be executing in the Python 
VM at a time.  But if the COM objects you use are implemented in *say) 
C++ and Python is only driving them, then although Python will not 
execute on both at once, the objects themselves might.  Of course, if 
you are talking about implementing these objects in Python, we are back 
in the same boat.

It may be possible for you to use RemoteServer COM objects, thereby 
having each object in its own process, and this would execute concurrently.

Mark.





More information about the Python-list mailing list