Advanced Python 3: Concurrency
Make programs do several things at once: processes, threads and the GIL, race conditions and locks, multiprocessing and executors, and modern asyncio with tasks, timeouts, queues, task groups and semaphores.
- Advanced level
- 4 modules
- 13 lessons
- 36 tasks and questions
Syllabus
01Concurrency conceptsThe ideas behind concurrent programs: sequential, concurrent and parallel execution, processes, threads and scheduling, I/O-bound versus CPU-bound work and the GIL, race conditions, locks and deadlock.4 lessons
02Threads, processes and executorsUse the threading, multiprocessing and concurrent.futures modules: start and join threads, pass work through queues, split CPU-bound work across processes, and manage pools of workers with executors and futures.3 lessons
03Concurrency with asyncioSingle-threaded concurrency with asyncio: coroutines and the event loop, tasks and gather, timeouts and cancellation, producer/consumer queues, task groups and semaphores.5 lessons
04ProjectPut asyncio to work on a realistic problem: concurrent queries with timeouts, failure handling, a concurrency limit, and a timing comparison against the sequential approach.1 lesson