Will Python 3.0 remove the global interpreter lock (GIL)

Ben Finney bignose+hates-spam at benfinney.id.au
Mon Sep 3 11:41:05 CEST 2007


Michele Simionato <michele.simionato at gmail.com> writes:

> On Sep 3, 2:21 am, llothar <llot... at web.de> wrote:
> > I'm afraid that the GIL is killing the usefullness of python for
> > some types of applications now where 4,8 oder 64 threads on a chip
> > are here or comming soon.
> 
> This is FAQ. You will find thousands of discussion on the net about
> that.

> My personal opinion (and I am not the only one in the Python
> community) is that if you want to scale the way to go is to use
> processes, not threads, so removing the GIL would be a waste of
> effort anyway.

Yes. Processes are cheap on well-designed operating systems, and using
processes to subdivide your processor usage encourages simple, modular
interfaces between parts of a program. Threads, while also cheap, are
much more difficult and fiddly to program correctly, hence are rarely
an overall win.

One common response to that is "Processes are expensive on Win32". My
response to that is that if you're programming on Win32 and expecting
the application to scale well, you already have problems that must
first be addressed that are far more fundamental than the GIL.

-- 
 \        "Pinky, are you pondering what I'm pondering?" "Umm, I think |
  `\   so, Brain, but three men in a tub? Ooh, that's unsanitary!"  -- |
_o__)                                            _Pinky and The Brain_ |
Ben Finney



More information about the Python-list mailing list