A technical look at the news of "Python moves to remove the GIL". Some coding & some source checking
Jadi
Python's usage exploded even when it was merely new; lacking lots of features. One main reason for this was its great integration with C libraries. Combine this with the possibility of using Threads and you will get your holy grail: and easy language with threads which can use C libraries! BUT! But python needed a Global Interpreter Lock to be able to run C Libraries in its threads.
In this video we will have a closer look at this concept. I will describe the necessity of GIL in Cpython and will show you why and how it is slowing down multi-threaded CPU hungry program. We will check the source code and will understand why both parties (defending and protesting the GIL removal) are claiming that the "You are slowing down Python!"
00:00 - Intro to the video 01:59 - Python vs. CPython 03:40 - Reference Counting in Python 07:20 - Ref Count Issues with Concurrency / Multi-Thread 09:33 - How GIL fixes Concurrency / Thread issues 14:35 - GIL Issues in CPU intensive threads sample 18:20 - Checking CPython for GIL 24:45 - GIL Removal History & nogil 26:55 - GIL removal side effects 31:00 - Further Reads (see desc)
Some sources: nogil: https://github.com/colesbury/nogil-3.12 PEP703: https://peps.python.org/pep-0703/ LWN Article: https://lwn.net/Articles/939981/ BackBlaze: https://www.backblaze.com/blog/the-python-gil-past-present-and-future/ RealPython: https://realpython.com/python-gil/ ... https://www.youtube.com/watch?v=6254JnkLg1c
249005721 Bytes