Understanding Multithreading by Deciphering the CPython Interpreter Source Code.

Abstract

I will speak from ground level covering very crucial aspects of Threading and Locks which will provide a better roadmap for community to develop better Python applications. I will provide a concise understanding of Threading and Global Interpreter Lock(GIL) in Python.
I will speak from ground level about threading and GIL in CPython reference implementation. Also, I will talk about the Non-GIL implementations of Python and how they compare with GIL implementation.

Description

### In the modern era of hybrid cores and processors, there is an in demand need for concurrent and parallel programming paradigms. Python, since its inception has amazing support for single threaded applications. The extensive use of Python in booming fields like Machine Learning has paved the way to constantly improve multi-threaded applications in Python. ### I will speak from ground level covering very crucial aspects of *Threading and Locks* which will provide a better roadmap for community to develop better Python applications. I will provide a concise understanding of Threading and *Global Interpreter Lock(GIL)* in Python. ## Contents to be covered: ### ***1. Threading for noobs:*** * Terminologies: Process, threads, multithreading, multiprocessing, types of threads, locks, mutex, CPU and I/O bound processes. * Multithreading in Python: Threading module (with example) Comparative analysis of Sequential vs Multithreaded execution in Python (with example) ### ***2. Understanding the global interpreter lock (GIL):*** * What and why of GIL * Impact of GIL on CPU and I/O Bound Processes * In-depth understanding of GIL using cpython interpreter source code * Reference counting * Ticks via context switching ### ***3. Infamous concepts:*** * Cooperative vs Preemptive multitasking * Parallelism vs Concurrency * Thread Safety in Python ### ***4. Removing the GIL + Non-GIL implementations:*** * Famous GIL removal patch * PyPy and how it works without GIL * Real-world examples where keeping the GIL intact works better * Guido on GIL, Larry Hastings Gilectomy ### ***5. Questions***

Speaker

Chirag Shah

Working as a Software Development Engineer at Barclays.Software development is my long suit. AI, ML and Data Science are my goto subjects. Competitive programming is something I love to do in my spare time. I like tinkering with new technologies, creating new projects and implementing things by myself from scratch. I am an avid learner and I can quickly adopt to new frameworks.
You can call me an "avidlearner and Pythonista"
I am also a speaker at PyCon India 2018, PyCon Balkan 2018 and PyCascades 2019.