Module 13 Overview
Module 13: Concurrency explores how to make your programs do more than one thing at a time. Whether you are downloading thousands of files or processing massive datasets, concurrency is the key to performance.
In this module, we will demystify the Global Interpreter Lock (GIL) and learn the three main ways to achieve concurrency in Python.
Learning Objectives
Section titled “Learning Objectives”By the end of this module, you will be able to:
- Understand the difference between Concurrency (task switching) and Parallelism (simultaneous execution).
- Use Threading for I/O-bound tasks (network requests, file operations).
- Use Multiprocessing to bypass the GIL for CPU-bound tasks (calculations).
- Write modern asynchronous code using AsyncIO (
async/await).
Module Contents
Section titled “Module Contents” Threading Concurrency for I/O-bound tasks and the GIL.
Multiprocessing True parallelism for CPU-bound tasks.
AsyncIO Cooperative multitasking with async/await.