MultiProcessor and Win32 threads

José Manuel Esteve Gómez jose.manuel.esteve at xps.xerox.com
Fri Dec 17 12:14:34 EST 1999


I am trying to write a multithreading application in Python to work on
Windows NT multiprocessor (4 processor) hardware.
Basically I am using the beginthreadex function from the win32 process
extension mudule from Mark Hammond.

The application runs fine and in fact the threads run on the different
processor, But it seems that the interpreter is proccesiing them
sequentially rather than in parallel, so they only profit 25% cpu time of
each processor.
I have been trying to find some info in the thread interest group , but the
only hint is that threading in Python depends o n a central lock, and seems
to be a patch for Python 1.4 but no patch for Python 1.52  to avoid this
problem.

Is  win32 process threading dependant on this central lock ???
Is there in fact a central lock that prevents parallel processing on a
multiprocessor NT environment ??
Is there any way to avoid that ???

On the other hand the function SetThreadIdealprocessor from win32process
seems to be broken.

Please take into account that the environment for this application will
always be Win NT that is why i am using win32 extension module.

Best Regards





More information about the Python-list mailing list