Python Concurrency From the Ground Up (2015) [video]
It&#x27;s very disappointing to see someone who seems authoritative spreading the myth that the GIL prevents you from using threads to achieve concurrency.<p>It didn&#x27;t work with his toy example, calling the Fibonacci function, because it&#x27;s pure Python. Typically, if you have pure CPU-bound processing like this then you wouldn&#x27;t want to use pure Python anyway as it would be too slow. You&#x27;d either using C extension library like numpy, scipy or pytorch, or (more rarely) write the code yourself in Cython. In either case the GIL is released whenever you make a call into them (you have to do it manually in Cython but it&#x27;s straightforward). If his example had been multiplying matrices together with np.dot then threads wouldn&#x27;t have been a problem.<p>The GIL is also released whenever you do I&#x2F;O like reading data from a socket or reading from a file. This includes libraries that do this for you, such as those reading from a database (whether a remote DBMS like Postgres or a file-based one like SQLite).<p>Taken together, these cover 99% of cases where you want concurrency. In that 1% where the GIL is not released, fixing that pure Python computation code is often worth doing before adding concurrency anyway.