Concurrency
Threading Basics
Creating and managing threads — the threading module, thread lifecycle, daemon threads, and when to use threads in Python.
Global Interpreter Lock (GIL)
Understanding the GIL — why Python threads are not truly parallel for CPU-bound work, and choosing the right concurrency strategy.
Multiprocessing
True parallelism with multiple processes — bypassing the GIL, process pools, shared memory, and inter-process communication.
asyncio Basics
async/await syntax and the asyncio framework — writing concurrent code using coroutines, tasks, and the event loop for I/O-bound operations.
Coroutines
Coroutine functions and cooperative multitasking — async def functions that can pause and resume, enabling non-blocking concurrent execution.
Event Loops
The asyncio event loop internals — how the loop schedules callbacks, manages tasks, and orchestrates concurrent execution.
Thread Synchronization
Locks, semaphores, conditions, and events — primitives for coordinating threads and preventing race conditions in shared state.
concurrent.futures
High-level concurrency API — ThreadPoolExecutor and ProcessPoolExecutor for simplified parallel execution with futures.
Thread-Safe Queues
The queue module for thread-safe inter-thread communication — Queue, LifoQueue, PriorityQueue for producer-consumer patterns.
Deadlocks and Race Conditions
Common concurrency bugs — understanding deadlocks, livelocks, race conditions, and strategies to detect and prevent them.