Guido van Rossum
๐ค SpeakerAppearances Over Time
Podcast Appearances
And that's sort of the moment that the GIL became infamous.
Because the GIL was the solution we used to sort of take this single interpreter and share it between all the different operating system threads that you could create.
And so as long as the hardware physically only had one CPU, that was all fine.
And then as hardware vendors were suddenly telling us all, oh, you got to paralyze.
Everything's got to be paralyzed.
People started saying, oh, but we can use multiple threads in Python.
And then they discovered, oh, but actually all threads run on a single core.
Yeah, there are a couple of possible futures there.
The most likely future is that we'll get multiple sub-interpreters, which each run a completely independent Python program.
Nice.
But there's still some benefit of...
of sort of faster communication between those programs.
Yeah.
It's hidden from you, but you have to spend more time communicating between those programs because the sort of, the attractive...
thing about the multi-threaded model is that the threads can share objects at the same time that's also the downfall of the multi-threaded programming model because when you do share objects you weren't and you didn't necessarily intend to share them or uh there were aspects of those objects that that were not reusable uh you get all kinds of concurrency bugs and so
The reason I wrote that little blog post about Semaphores was that concurrency bugs are just harder.
It would be nice if Python had no global interpreter lock and it had so-called free threading, but it would also cause a lot more software bugs.
The interesting thing is that there is still a possible future where we are actually going to or where we could experiment at least with that.
Because there is a guy working for Facebook who has developed a fork of CPython.
that he called the no-GIL interpreter, where he removed the GIL and made a whole bunch of optimizations so that the single-threaded case doesn't run too much slower and multi-threaded case will actually use all the cores that you have.