Parallelization in Python 2.6

sturlamolden sturlamolden at yahoo.no
Wed Aug 19 09:14:01 EDT 2009


On 19 Aug, 05:27, Dave Angel <da... at ieee.org> wrote:

> With the current GIL implementation, for two CPU-bound tasks, you either
> do them sequentially, or make a separate process.

I'd also like to add that most compute-bound code should be delegated
to specialized C libraries, many of which are prewritten. For example,
FFTW, Intel MKL, ATLAS, LAPACK, NAG. When you do this, the GIL has no
consequence unless it is kept locked. So even for scientific programs,
writing parallel compute-bound code mostly involves calling into a C
or Fortran library with the GIL released. I have yet to see compute-
bound code that could not be easily migrated to C or Fortran, either
using existing libraries (the common case) or specialised code.



More information about the Python-list mailing list