Multi-threading python

Aahz aahz at
Wed Sep 11 13:06:13 EDT 2002

In article <alnmcs$gdt$1 at>,
David Brown <david at> wrote:
>If C code (or other extensions) that take significant time, or block for
>other reasons, release the GIL then there I suppose there is not going to be
>much of a problem.  The point is to maximize the throughput, and avoid
>threads blocking each other unnecessarily.


>It sounds like that is only true for code that does a lot of work in pure
>python (rather than with time-consuming, GIL-released C code).


>Thanks for the information - it was definitely helpful.  It looks like the
>system used by Python will work fine in all but a few situations (SMP system
>in which a lot of work is being done in Python itself, rather than in
>extension modules - or in badly written extensions which don't release the
>GIL before doing heavy work).  Such situations can be dealt with by running
>two python processes - if a program really needs to do hard SMP work in
>python, then that is a small price to pay since I image the GIL simplifies a
>lot of things.  I had been worried that the Python threading scheme would
>have caused more inefficiences (such as all threads stopping while a single
>thread was blocked for I/O).

Aahz (aahz at           <*>

Project Vote Smart:

More information about the Python-list mailing list