21

I was sure that it hasn't, but looking for a definite answer on the Interwebs left me in doubt. For example, I got a 2008 post which sort of looked like a joke at first glance but seemed to be serious at looking closer.

Edit: ... and turned out to be a joke after looking even closer. Sorry for the confusion. Actually the comments on that post answer my question, as Nikhil has pointed out correctly.

We realized that CPython is far ahead of us in this area, and that we are lacking in compatibility. After serious brainstorming (and a few glasses of wine), we decided that introducing a Global Interpreter Lock in Jython would solve the entire issue!

Now, what's the status here? The "differences" page on sourceforge doesn't mention the GIL at all. Is there any official source I have overlooked?

Note also that I'm aware of the ongoing discussion whether the GIL matters at all, but I don't care about that for the moment.

Community
  • 1
  • 1
Hanno Fietz
  • 30,799
  • 47
  • 148
  • 234
  • It seems I am not used to the Pythonic humour yet. It took me a while to get what was going on in that post I cited. Thanks for your hints. – Hanno Fietz Jul 18 '09 at 14:20

4 Answers4

26

The quote you found was indeed a joke, here is a demo of Jython's implementation of the GIL:

Jython 2.5.0 (trunk:6550M, Jul 20 2009, 08:40:15) 
[Java HotSpot(TM) Client VM (Apple Inc.)] on java1.5.0_19
Type "help", "copyright", "credits" or "license" for more information.
>>> from __future__ import GIL
  File "<stdin>", line 1
SyntaxError: Never going to happen!
>>> 
Frank Wierzbicki
  • 1,566
  • 11
  • 10
23

No, it does not. It's a part of the VM implementation, not the language.

See also:

from __future__ import braces
Lennart Regebro
  • 167,292
  • 41
  • 224
  • 251
5

Both Jython and IronPython "lack" the GIL, because it's an implementation detail of the underlying VM. There was a lot of information I've found sometime ago, now the only thing I could come up with is this.

Remember that the GIL is only a problem on multiprocessor enviroment only, and that it's unlikely to go away in the foreseable future from CPython.

Esteban Küber
  • 36,388
  • 15
  • 79
  • 97
-1

Google is making a Python implementation that is an modified cpython with performance improvements called unladen swallow. This will take care of removing the GIL. See: Unladen Swallow

Per Arneng
  • 2,100
  • 5
  • 21
  • 32
  • It looks like they are not removing it after all. The approach they took (for removing GIL) turned out to be too naive, so they dropped that idea and instead focused on getting the speedups on single-core. See this talk [1] [1] http://pycon.blip.tv/file/3261170/ – konryd Mar 07 '10 at 00:20
  • Unladen's choice of LLVM turned out to not speed up a dynamic language like Python enough. Right now PyPy is much faster, but also still has the GIL due to lack of re-entrant garbage collectors: http://doc.pypy.org/en/latest/faq.html#does-pypy-have-a-gil-why – Cees Timmerman Mar 12 '12 at 10:59