[Baypiggies] Guido's Blog: It isn't Easy to Remove the GIL

William Deegan bdbaddog at gmail.com
Fri Sep 14 22:16:27 CEST 2007


...

> However, I want to warn that there are many downsides to removing the GIL.
> It complicates life for extension modules, who can no longer expect that
> they are invoked in a "safe zone" protected by the GIL -- as soon as an
> extension has any global mutable data, will have to be prepared with
> concurrent calls from multiple threads. There might also be changes in the
> Python/C API necessitated by the need to lock certain objects for the
> duration of a sequence of calls.
...

I don't know much about the implementation of extension modules, but
might it work to effectively have GIL around modules which don't
register their ability to handle multiple threads?

So python's engine would run multi-threaded, when it calls an
extension module, it would use a lock on entry/exit to any module
which is not thread aware?

I'm sure there's huge holes in this idea, but I thought I'd put it out there.

-Bill


More information about the Baypiggies mailing list