dual CPU-mode in python
Fredrik Lundh
fredrik at pythonware.com
Sun Mar 5 12:42:41 EST 2006
Astan Chee wrote:
> I have a python script which i convert to an executeable (using py2exe)
> and on a dual-cpu machine seems to be taking only 50% (1cpu) only. I was
> wondering if there is a way to maximize CPU usage without forking the
> function?
it depends on what your script is doing. the GIL makes it impossible to
use more than one CPU per process for "byte code intensive" code:
http://docs.python.org/api/threads.html
but code that uses I/O or C-level crunching can get around this, if the
C-level code is properly written.
</F>
More information about the Python-list
mailing list