HackerTube

Understanding the Python GIL

David Beazley4 HN recommenders · recommended in 4 months, 2013–2023
YouTube
talk · intermediate · 2013–2023 on HN

David Beazley's PyCon 2010 talk explains how the Python Global Interpreter Lock works and shows experiments where multithreaded code runs slower, even on more cores, due to lock contention and context-switching overhead.

The canonical recommendation for understanding the GIL, praised both for its clarity and for how well it explains a deep technical topic.

8 comments from Hacker News

@famousactress2014-01 · in “Code is not Literature”

"The point of such a presentation is to take a piece of code that the presenter has understood deeply and for them to help the audience understand the core ideas..." I do get lots of value out of that. My favorite example is Beazley's GIL talk: ▶ this video

Strongly recommends View on HN
@gshulegaard2022-08 · in “How to choose the right Python concurrency API”

I am not expert, and this might be dated information, but historically there is a "thrashing" introduced between the GIL and OS scheduled threads which has surprising performance implications. David Beazley does a much better illustrating the nuances than I ever could: ▶ this video Including a wild phenomenon where a threaded Python program's performance can degrade by increasing number of CPU cores available to a system. Coroutines avoid this by not requiring individual thread scheduling by the OS. So they effectively release the GIL like threads on IO but avoid OS level thread switching.

Recommends View on HN
@devxpy2018-07 · in “Code with Mu: a simple Python editor for beginner programmers”

David probably isnt the best guy for that. But here's one of the famous ones on GIL. ▶ this video Beware though, his talks are known to be devastating to the programmer, resulting in serious head injuries, trauma, headaches and other fun stuff.

Recommends View on HN
@Luyt2013-06 · in “Python's Hardest Problem (2012)”

"I never actually got around to learning -- or even thinking about!-- what exactly the GIL is" David Beazley does a good job on explaining the GIL. There are multiple videos of his GIL talks on YouTube. This one, for instance: ▶ this video He has a page about this at link

Recommends View on HN
@rvanlaar2023-10 · in “Progress on No-GIL CPython”

There's a GIL presentation [1] from 2010 which shows Python 3.2 on a 1 CPU machine was faster than on a dual core. In all, there might be reason to expect GILless python to be faster single core in certain scenario's. [1] ▶ this video