HackerNoon.com
Published in

HackerNoon.com

Has the Python GIL been slain?

The GIL.

What is the GIL?

Avoiding the GIL in CPython

from multiprocessing import Process

def f(name):
print 'hello', name

if __name__ == '__main__':
p = Process(target=f, args=('bob',))
p.start()
p.join()

PEP554 and the death of the GIL?

What if there was a better way?

That looks inefficient

Pickle v5 and Sub-Interpreters PoC

That sure looks like a lot of boilerplate

How much overhead does a sub-interpreter have?

  • modules in the __main__ namespace and importlib
  • the sys dictionary containing
  • builtin functions ( print() , assert etc)
  • threads
  • core configuration

What about asyncio?

Sounds great, ship it!

Conclusion: Is the GIL dead?

When?

--

--

Elijah McClain, George Floyd, Eric Garner, Breonna Taylor, Ahmaud Arbery, Michael Brown, Oscar Grant, Atatiana Jefferson, Tamir Rice, Bettie Jones, Botham Jean

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Anthony Shaw

Group Director of Talent at Dimension Data, father, Christian, Python Software Foundation Fellow, Apache Foundation Member.