advanced Estimated learning time: 6 h

2.16 Concurrency: threads, processes, asyncio

You can make I/O-bound work fast without corrupting state.

Before:00. Orientation & SetupUnlocks:03. Data Handling & Analysis04. Classical AI — Agents, Search & Knowledge Representation

Concurrency makes waiting-bound work — API calls, downloads, scraping — dramatically faster, and this topic sorts the tools by job: threads help with waiting, processes with computing, async with very many small waits. The GIL is the fact that explains the split. It sits in the advanced run because the agent and serving work ahead depends on it. The classic mistake is sprinkling async onto CPU-bound code and wondering why nothing improved; the event loop cannot parallelise arithmetic.

Work through these

  • The GIL and what it actually blocks

    The interpreter lock prevents two Python instructions running at once, which limits some kinds of parallelism and not others. Knowing precisely what it blocks is the whole topic.

  • threading and concurrent.futures

    Threads and the higher-level interface for running work in parallel, which help when the program is waiting rather than computing. This is the right tool for network-bound work.

  • multiprocessing for CPU-bound work

    Separate processes sidestep the lock and genuinely use several cores, at the cost of not sharing memory. This is the right tool for computation-bound work.

  • async/await, event loops, aiohttp

    Asynchronous code lets one process manage thousands of waiting operations without threads. It is a different way of thinking, and it is what modern network libraries expect.

Sign in to keep your progress.

Free resources

Links last checked 29 Aug 2026.

Stuck here?

Ask a mentor. A real person answers, and they can see exactly which topic you're on. Usually within a couple of working days.

Checking your session…

Topics shown in module order.