← Winnitude! Search  ·  Reader Mode (665 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
REAL PYTHON · Real Python · 35 LINKS

Concurrency and Async Programming (Learning Path) - Real Python

Concurrency and Async Programming

Learning Path ⋅ Skills: Python, Concurrency, Async IO, Global Interpreter Lock, Thread Safety, Parallel Processing, Performance Optimization, Multithreading, Async Iterators, Free Threading

Speed Up Your Python Program With Concurrency

Python can do more than one thing at a time, but which tool you reach for depends on whether your work is I/O-bound or CPU-bound. You'll start with an overview of Python's concurrency options, then dig into the GIL that shapes all of them. From there, you'll write threaded code and keep it safe with locks, build asynchronous programs with async/await and asyncio , and finish with parallel processing and free-threaded Python.

Concurrency and Async Programming

Learning Path ⋅ 10 Resources

Is this path right for you? Mentor AI knows what's in it and can help you decide where to begin.

  • Ask Mentor AI
  • Pick a question and Mentor AI takes it from here.
  • Is this path right for me?
  • Where should I start?

  • Ask something else...

Understanding Python Concurrency

Before diving deep, get an overview of what concurrency means in Python. You'll learn about the different approaches to running code concurrently and when to use each one.

Course

Speed Up Python With Concurrency

Learn what concurrency means in Python and why you might want to use it. You'll see a simple, non-concurrent approach and then look into why you'd want threading, asyncio, or multiprocessing.

Interactive Quiz

Python Concurrency

The Global Interpreter Lock (GIL)

You've seen what concurrency means in Python and which approach suits which kind of work. Next, you'll look at the GIL , the CPython lock that decides how much those approaches can actually speed up your code. Understanding it explains the threading and async trade-offs you'll meet through the rest of this path.

Course

Understanding Python's Global Interpreter Lock (GIL)

Python's Global Interpreter Lock or GIL, in simple words, is a mutex (or a lock) that allows only one thread to hold the control of the Python interpreter at any one time. In this video course you'll learn how the GIL affects the performance of your Python programs.

Interactive Quiz

What Is the Python Global Interpreter Lock (GIL)?

Working With Threads

Now that you know why only one thread runs Python bytecode at a time, you can see where threads still pay off, namely I/O-bound work. You'll use Python's threading module, then guard shared state with locks and other techniques that keep race conditions out of your code.

Course

Threading in Python

In this intermediate-level course, you'll learn how to use threading in your Python programs. You'll see how to create threads, how to coordinate and synchronize them, and how to handle common problems that arise in threading.

Interactive Quiz

Python Threading

Course

Thread Safety in Python: Locks and Other Techniques

Learn about the issues that can occur when your code is run in a multithreaded environment. Then you'll explore the various synchronization primitives available in Python's threading module, such as locks, which help you make your code safe.

Interactive Quiz

Python Thread Safety: Using a Lock and Other Techniques

Podcast

Python Thread Safety & Managing Projects With uv

Asynchronous Programming With asyncio

Threads share memory, so you have to lock it. Async programming takes the other route, running I/O-bound work cooperatively in one thread. You'll trace how coroutines grew out of generators, write async/await code with asyncio , and build asynchronous iterators and iterables of your own.

Tutorial

Async Programming in Python: From Generators to asyncio

Learn how Python async programming works. Write async functions with async and await, and run slow I/O operations concurrently with asyncio.

Interactive Quiz

Async Programming in Python: From Generators to asyncio

Course

Hands-On Python 3 Concurrency With the asyncio Module

Learn how to speed up your Python 3 programs using concurrency and the asyncio module in the standard library. See step-by-step how to leverage concurrency and parallelism in your own programs, all the way to building a complete HTTP downloader example app using asyncio and aiohttp.

Interactive Quiz

Python's asyncio: A Hands-On Walkthrough

Course

Exploring Asynchronous Iterators and Iterables

Learn to build async iterators and iterables in Python to handle async operations efficiently and write cleaner, faster code.

Interactive Quiz

Asynchronous Iterators and Iterables in Python

Going Beyond the GIL

For CPU-bound tasks, you'll need to bypass the GIL. Learn about parallel processing techniques and Python 3.13's new free-threading capabilities.

Tutorial

Bypassing the GIL for Parallel Processing in Python

In this tutorial, you'll take a deep dive into parallel processing in Python. You'll learn about a few traditional and several novel ways of sidestepping the global interpreter lock (GIL) to achieve genuine shared-memory parallelism of your CPU-bound tasks.

Interactive Quiz

Bypassing the GIL for Parallel Processing in Python

Tutorial

Python 3.13: Free Threading and a JIT Compiler

Python 3.13 enhanced Python performance. Make a custom Python build with Docker to enable free threading and a JIT compiler. Learn how these features affect the language's ecosystem.

Interactive Quiz

Python 3.13: Free Threading and a JIT Compiler

Podcast

The Joy of Tinkering & Python Free-Threading Performance

Test Your Knowledge

You've made it through the entire path! In the wrap-up quiz below, you'll revisit the most important ideas about Python concurrency, the GIL, threading, thread safety, asyncio, async iterators, and free-threaded Python 3.13. Use it to spot any topics that still feel rusty before moving on.

Interactive Quiz

Concurrency and Async Programming

Test your understanding of Python concurrency, the GIL, threading, thread safety, asyncio, async iterators, and free-threaded Python 3.13.

Congratulations on completing this learning path! You've learned how Python handles concurrency, from the fundamentals through threading, async programming, and strategies for bypassing the GIL.

Continue your advanced Python journey with the next learning path:

Learning Path

Database Access With Python

9 Resources ⋅ Skills: SQL Libraries, SQLite, SQLAlchemy, Redis, MySQL, MongoDB, ChromaDB, Data Management, NoSQL Databases, Vector Databases, DuckDB, TinyDB, SQL Security

You might also be interested in these related learning paths:

Got feedback on this learning path?

Looking for real-time conversation? Visit the Real Python Community Chat or join the next "Office Hours" Live Q&A Session . Happy Pythoning!

« Browse All Learning Paths