Better utilization of duo-core?

J

John Henry

Hi list,

I have a Python ap that starts another non-Pythoon ap for number
crunching. My new notebook comes with a duo-core CPU. I tried
manually running 2 copies of my ap at the same time) and it appears to
run the whole job faster (or at least the CPU loading level as show by
the task manager appears so). So, I want my Python code to do this
automatically.

How do I detect whether I have additional CPUs in the system? The
google search turns up answer about a Sun workstation but not Windows
XP.

Thanks,
 
F

Fredrik Lundh

John said:
How do I detect whether I have additional CPUs in the system? The
google search turns up answer about a Sun workstation but not Windows
XP.

count = int(os.environ.get("NUMBER_OF_PROCESSORS", 1))

</F>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top