I just killed GIL!!!

Jonathan Gardner jgardner at jonathangardner.net
Thu Apr 17 13:11:27 EDT 2008


On Apr 17, 6:40 am, Steve Holden <st... at holdenweb.com> wrote:
> I'd love to be wrong about that, but the GIL *has* been the subject of
> extensive efforts to kill it over the last five years, and it has
> survived despite the best efforts of the developers.
>

To add to that...

In my mind, I see three options for multi-process systems:

(1) Locks.
(2) A global lock (GIL)
(3) Learning to live with the possibility of things disappearing out
from under you.

In the SQL world, they chose (3). In the Java/C++/C# world, they chose
(1). I like Python's compromise a lot, even though it means in a
single process, you can only have one thread doing Python at a time.
Usually the bits I want to parallelize on are blocking system calls to
the network or disk anyway, or the result of a long calculation that
updates its result all at once. So having the OS handle the tough bits
while I program in a fantasy world where threads are an illusion is
fine with me.

Discovering a way to get rid of the GIL and not have to do (1) and (3)
is truly exciting, but I've lost hope a long time ago.

Besides, if it gets in the way I can always do something novel like, I
don't know, spawn another Python process?



More information about the Python-list mailing list