News for hackers. Stuff that matters.
Re:Python's Hardest Problem (2012) by georgemcbay on Monday June 03, 2013 @07:07PM (#5816685)
I don't know a lot about the history of Python and the GIL, but did they ever consider optionally removing the GIL or leaving it in depending upon some switch? Go has GOMAXPROCS which defaults to 1 to avoid the overhead of locking when only a single thread will be used for similar purposes.

I guess back in 1996 a system like that may have been considered overkill because multithreading was still pretty exotic.

Re:Python's Hardest Problem (2012) by somejan on Tuesday June 04, 2013 @11:43AM (#5820102)
Having a look at the source, you get this for free in python. If you don't use any threads the overhead is just the checking of one (non-atomic) variable in the main eval loop, so that is at least as cheap as GOMAXPROCS=1 in Go. There is a small overhead of dropping/taking the gil around I/O functions, but it isn't worth optimizing the few nanoseconds that takes for the much slower i/o functions.

But if even this overhead is too much you can compile python without treading support.

Re:Python's Hardest Problem (2012) by somejan on Tuesday June 04, 2013 @02:17PM (#5821164)
Ok, the above is not really relevant, I misread the parent comment. Why the gil is not completely removed or made optional can be read at http://wiki.python.org/moin/GlobalInterpreterLock
Re:Python's Hardest Problem (2012) by somejan on Tuesday June 04, 2013 @08:09AM (#5818881)
The overhead of the GIL is probably insignificant for a single threaded python program, in part because the GIL is very coarse grained. Go uses (afaik) finer grained synchronization that therefore has more overhead. Also since python is slower anyway the relative cost of locking is much smaller than in the faster Go.
Re:Python's Hardest Problem (2012) by lmm on Tuesday June 04, 2013 @02:05AM (#5817964)
I believe it was considered and rejected because CPython wants to be simple, understandable code (there's a general policy of rejecting performance-improvement patches if they complicate the code too much). Other implementations exist without a GIL (e.g. IronPython).