Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Better utilization of duo-core?

Reply
Thread Tools

Better utilization of duo-core?

 
 
John Henry
Guest
Posts: n/a
 
      07-13-2006
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,

 
Reply With Quote
 
 
 
 
Fredrik Lundh
Guest
Posts: n/a
 
      07-13-2006
John Henry wrote:

> 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>

 
Reply With Quote
 
 
 
 
Fredrik Lundh
Guest
Posts: n/a
 
      07-13-2006
Fredrik Lundh wrote:

>> 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))


footnote: a more "correct" way to do this is to use WMI. links:

http://timgolden.me.uk/python/wmi.html


http://msdn.microsoft.com/library/en...r_hardware.asp
(look for "determine if a computer has more than one processor"

</F>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Build a Better Blair (like Build a Better Bush, only better) Kenny Computer Support 0 05-06-2005 04:50 AM
Memory utilization for Windows services Jay Kavimandan ASP .Net 1 11-02-2004 11:41 AM
Low memory utilization sort? pt Perl 1 06-04-2004 11:09 AM
Stats on bandwidth utilization by port needed 1 Cisco 2 12-13-2003 06:46 AM
High utilization on network with Cisco 4500M LAN Interface Sarah Cisco 3 12-01-2003 10:09 PM



Advertisments