Andy wrote: > Hi guys, > > I'm sorry, I'm not sure this is the correct group to be asking this > kind of question... > > 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, but I'm confused on how to take advantage of the multiple > CPUs. > >>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. > > Is my understanding correct? So actually, all I have to do is just > write my multi-threaded Python code as usual? And how is it decided > which process and which threads go to CPU 1, CPU 2, etc.? Perhaps the > BIOS? > > Any advice greatly appreciated. > Andy >
The Python interpreter is not multi-cpu aware, so using Python threads won't work on multiple CPUs. If your tasks are CPU-bound, then fork multiple processes. Most web servers (Apache) can handle this automatically for you. -- http://mail.python.org/mailman/listinfo/python-list