[Python-Dev] Fwd: Removal of GIL through refcounting removal.

Brian Granger ellisonbg.net at gmail.com
Fri Oct 31 18:55:57 CET 2008


>> Has anyone made the argument for keeping the GIL to discourage
>> threading?
>
> Oooh, you are on to my secret plan! :-)

I completely agree that there are other approaches to parallelism and
concurrency that are much better than threading.  However, I don't
think this is a good argument for having poor support for parallel
threads in Python (i.e. keeping the GIL).  The reason is that threads
are extremely useful (and often required) for implementing other
approaches to concurrency, such as message passing.  Two examples:

Take Erlang for example.  Erlang uses a shared nothing/message passing
approach to concurrency (Yes!).  However, Erlangs implementation of
this approach relies heavily upon threads in the low-level of the
interpreter.  Without this usage of threads Erlang would be able to
provide the multicore scalability that it does using message passing.

Same is true of MPI.  From the user's perspective MPI is just message
passing.  But, MPI implementations use threads internally extensively.

Bottom line: threads may be a bad end in themselves (I agree with
this), but they are a great means to better things.

Cheers,

Brian


More information about the Python-Dev mailing list