Development for dual core machine

Bjoern Schliessmann usenet-mail-0306.20.chr0n0ss at spamgourmet.com
Sun Aug 19 08:37:23 EDT 2007


Andy wrote:

> I'm going to develop a software package that includes a web server
> (and PHP code) , a database, and some Python code of course.  I am
> being strongly suggested to make it to work on a dual- or
> multi-core computer, 

No problem. CPython will work on any dual core CPU.

> but I'm confused on how to take advantage of the multiple CPUs.

First: Use a web server that can make use of multiple cores.

Second: Use a data base that can make use of multiple cores.

Third, for using multiple cores from CPython: this is an FAQ, please
look at the mailing list archives. Whether you should optimize your
python application to use all cores strongly depends on what your
Python application actually does.
 
> From what I read, I think that simply by making the package run in
> several separate processes (web server, database server, Python
> interpreter, etc.), and/or using multiple threads (which I will
> anyway) the package should be able to use multiple CPUs.

CPython has the GIL (global interpreter lock). Please search for it
in the archives, it's been discussed exhaustingly.
 
> And how is it decided which process and which threads go to CPU 1,
> CPU 2, etc.? Perhaps the BIOS?

No, the kernel (i. e., Linux). The BIOS is completely out of this.

Regards,


Björn

-- 
BOFH excuse #388:

Bad user karma.




More information about the Python-list mailing list