Syllabus

  1. 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
    1. 01Sequential, concurrent and parallel
    2. 02Processes and threads
    3. 03I/O-bound work, CPU-bound work and the GIL
    4. 04Race conditions, locks and deadlock
  2. 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
    1. 01Threads with the threading module
    2. 02Processes with multiprocessing
    3. 03Executors and futures
  3. 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
    1. 01Coroutines and the event loop
    2. 02Tasks and gather
    3. 03Timeouts and cancellation
    4. 04Producers and consumers with asyncio.Queue
    5. 05Task groups and semaphores
  4. 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
    1. 01Project: a concurrent price checker