AI Instructor Live Labs Included

Async Python and Concurrency

Master Python concurrency — asyncio, threading, multiprocessing, and task orchestration for I/O-bound and CPU-bound workloads.

Advanced
11h 5m
12 Lessons
PY-700
Async Python and Concurrency Badge

View badge details

About This Course

Demystify Python's concurrency models. This course teaches the GIL and when it matters, threading for I/O-bound tasks, asyncio for single-threaded concurrency, async HTTP/file/database I/O, task orchestration with semaphores and producer/consumer patterns, and multiprocessing for CPU-bound work. Every lesson uses realistic scenarios with measurable performance differences. The capstone builds a concurrent data pipeline that ingests from multiple sources, processes in parallel, and handles errors gracefully. Requires solid Python experience with FastAPI and testing. Course 7 of 10 in the Python Learning Path.

Course Curriculum

12 Lessons
01
AI Lesson
AI Lesson

The GIL Threads and Processes

35m

AI-led teaching session covering concurrency vs parallelism, the GIL (what it is, what it prevents, why it exists), threading.Thread and shared state risks, thread safety with Lock and Queue, and ThreadPoolExecutor for I/O-bound tasks. Fictional company: StreamForge.

02
Lab Exercise
Lab Exercise

The GIL Threads and Processes - Lab Exercises

1h 15m 1 Exercises

Concurrency vs parallelism, the GIL (what it is/prevents/why it exists), threading.Thread and shared state risks, thread safety with Lock and Queue, ThreadPoolExecutor for I/O-bound tasks

GIL Deep Dive: Threading vs Multiprocessing Performance Analysis GIL Deep Dive: Threading vs Multiprocessing Performance Analysis ~30 min
03
AI Lesson
AI Lesson

asyncio Fundamentals

40m

AI-led teaching session covering event loop and single-threaded concurrency, async def and await, asyncio.create_task and gather/wait, awaitables (coroutines vs tasks vs futures), and common mistakes (forgetting await, blocking calls). Fictional company: StreamForge.

04
Lab Exercise
Lab Exercise

asyncio Fundamentals - Lab Exercises

1h 15m 1 Exercises

Event loop and single-threaded concurrency, async def and await, asyncio.create_task and gather/wait, awaitables (coroutines vs tasks vs futures), common mistakes (forgetting await, blocking calls)

Advanced AsyncIO Performance Patterns and Concurrency Management Advanced AsyncIO Performance Patterns and Concurrency Management ~30 min
05
AI Lesson
AI Lesson

Async IO HTTP Files and Databases

35m

AI-led teaching session covering aiohttp ClientSession and connection pooling, httpx AsyncClient for async HTTP, aiofiles for async file I/O, aiosqlite for async database, and mixing sync and async with asyncio.to_thread. Fictional company: StreamForge.

06
Lab Exercise
Lab Exercise

Async IO HTTP Files and Databases - Lab Exercises

1h 15m 1 Exercises

aiohttp ClientSession and connection pooling, httpx AsyncClient for async HTTP, aiofiles for async file I/O, aiosqlite for async database, mixing sync and async with asyncio.to_thread

High-Performance Async I/O with Concurrent Database and File Operations High-Performance Async I/O with Concurrent Database and File Operations ~30 min
07
AI Lesson
AI Lesson

Task Orchestration and Patterns

40m

AI-led teaching session covering semaphores for rate limiting, timeouts with wait_for and asyncio.timeout, error handling with return_exceptions and TaskGroup, producer/consumer with asyncio.Queue, and retry with exponential backoff and jitter. Fictional company: StreamForge.

08
Lab Exercise
Lab Exercise

Task Orchestration and Patterns - Lab Exercises

1h 15m 1 Exercises

Semaphores for rate limiting, timeouts with wait_for and asyncio.timeout, error handling with return_exceptions and TaskGroup, producer/consumer with asyncio.Queue, retry with exponential backoff and jitter

Exercise 1 Exercise 1 ~30 min
09
AI Lesson
AI Lesson

multiprocessing for CPU-Bound Work

35m

AI-led teaching session covering when to use multiprocessing vs async, ProcessPoolExecutor with map and submit, pickle constraints for cross-process data, shared state with Value and Queue, and decision tree (I/O-bound vs CPU-bound vs mixed). Fictional company: StreamForge.

10
Lab Exercise
Lab Exercise

multiprocessing for CPU-Bound Work - Lab Exercises

1h 15m 1 Exercises

When to use multiprocessing vs async, ProcessPoolExecutor with map and submit, pickle constraints for cross-process data, shared state with Value and Queue, decision tree (I/O-bound vs CPU-bound vs mixed)

Exercise 1 Exercise 1 ~30 min
11
AI Lesson
AI Lesson

Capstone Briefing Concurrent Data Pipeline

30m

AI-led capstone briefing covering the design and architecture of a concurrent data pipeline with async HTTP ingestion, producer/consumer queues, CPU-bound processing via ProcessPoolExecutor, error handling with timeouts and retries, and performance metrics. Fictional company: StreamForge.

12
Lab Exercise
Lab Exercise

Capstone Concurrent Data Pipeline

1h 15m 1 Exercises

Capstone: build concurrent pipeline with async HTTP ingestion from 10 sources with rate limiting, producer/consumer queue with 3 async workers, CPU-bound processing via ProcessPoolExecutor, error handling with timeouts and retries, JSON output with performance metrics

Exercise 1 Exercise 1 ~30 min

This course includes:

  • 24/7 AI Instructor Support
  • Live Lab Environments
  • 6 Hands-on Lessons
  • Completion Badge
Async Python and Concurrency Badge

Earn Your Badge

Complete all lessons to unlock the Async Python and Concurrency achievement badge.

Category
Skill Level Advanced
Total Duration 11h 5m
Async Python and Concurrency Badge
Achievement Badge

Async Python and Concurrency

Demonstrates proficiency in Python concurrency — asyncio, threading, multiprocessing, and task orchestration patterns.

Course Async Python and Concurrency

Skills You'll Earn

Python asyncio Threading Multiprocessing Concurrency Producer/Consumer Rate Limiting

Complete all lessons in this course to earn this badge