can multi-core improve single funciton?

Robert Kern robert.kern at gmail.com
Fri Feb 20 22:52:02 CET 2009


On 2009-02-20 13:20, Unknown wrote:
> On 2009-02-20, Aahz<aahz at pythoncraft.com>  wrote:
>> Steven D'Aprano<steven at REMOVE.THIS.cybersource.com.au>  wrote:
>>
>>> As I understand it, there's very little benefit to multi-cores
>>> in Python due to the GIL.
>> As phrased, your statement is completely wrong.  Here's a more
>> correct phrasing: "For threaded compute-bound applications
>> written in pure Python, there's very little benefit to
>> multiple cores." But threaded I/O-bound applications do
>> receive some benefit from multiple cores, and using multiple
>> processes certainly leverages multiple cores.  If boosting the
>> performance of a threaded compute-bound application is
>> important, one can always write the critical parts in C/C++.
>
> Do the crunchy bits of scipy/numpy, scientific python, vtk and
> other compute-intensive libraries tend to release the GIL while
> they're busy "computing"?

Often. Not as often as they could, sometimes.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco




More information about the Python-list mailing list