
I wonder why you didn't mention asynchronous programming with the async keyword.
Right now, they are the preferred way when it comes to IO-bound operations.
Anyway, the implantation of GIL is not defined by Python per se, it is just a well-known design feature of CPython. The other Python implementations are often GIL-free.
Ayesha Sahar
Developer | Designer | Tech Blogger
Akash Desarda
Building Data product powered by Machine learning
You should have included example for multiprocessing too. Also more practical example, easy to understand real world use case. Also I would suggest you to explore joblib, it much better option than the built-in implementation. It have a common api for peocess based & thread based parallelism.