Python Concurrency Learning Paths
Python concurrency is a big topic and can be challenging for beginners.
This page provides you with step-by-step learning paths that you can use to get started and get good at Python concurrency.
You might want to bookmark this page and come back to it again and again.
Table of Contents
Choose a Concurrency API
The first step is to choose a concurrency API.
This depends on the specific details of the tasks you wish to execute.
Use a simple step-by-step procedure to help you choose the right Python concurrency API for your project:
The diagram below will help to summarise the decisions you need to make when choosing a concurrency API.

Threading Learning Path
Python provides thread-based concurrency in the “threading” module.
This section provides a learning path that you can use to get started and get effective with the threading module, super fast.
- Step 1: Discover what a thread is in Python.
- Step 2: Discover how to run code in a new thread.
- Step 3: Discover how get the most out of threads.
Next, you can browse all tutorials or dive into a topic below to learn more.
Configure Threads
- How to Configure Threads
- How to Change the Thread Name
- How to Use Daemon Threads
- Handle Unexpected Exceptions
Basic Threading
- Thread Blocking Call
- What is the Main Thread
- How to Query Thread Attributes
- Thread Utility Functions
- How to Use Thread-Local Data
- How to Join a Thread
- How to Restart a Thread
- Wait for a Result from a Thread
Intermediate
- Share Variables Between Threads
- Threading Return Values
- How to Stop a Thread
- How to Close a Thread
- How to Kill a Thread
- Auto-Start Threads
- How to Sleep a Thread
Advanced Threading
- 5 Threading Anti-Patterns
- Interrupt the Main Thread
- Thread Context Variables
- Thread Stack Size
- Context Switch Interval
Thread-Safe Queues
- Thread-Safe Queue
- Thread-Safe SimpleQueue
- Thread-Safe LifoQueue
- Thread-Safe Priority Queue
- Queue task_done() and join()
Background Threads
Thread Safety
- Thread Atomic Operations
- Volatile Variables
- Thread-Safe Counter
- Thread-Safe Print
- Thread-Safe Logging
- Thread-Safe Dictionary
- Thread-Safe List
- Thread-Safe Write to File
- Thread-Safety Context Managers
- Thread-Safe Random Numbers
Failure Modes
- How to Identify a Deadlock
- Thread Livelocks in Python
- Race Condition With Timing
- Race Condition Shared Variable
- Thread Starvation in Python
Sync Primitives
- Threading Mutex Lock
- Threading RLock
- Threading Condition Variable
- Threading Semaphore
- Threading Event Object
- Threading Timer Thread
- Threading Barrier
- Lock vs Semaphore
- Advanced Semaphore Examples
Intermediate Locking
Advanced Locking
- Lock Contention
- Lock Striping in Python
- Lock Splitting in Python
- Lock Retry with Back-Off
- Thread Lock Overhead
- How to Use a Spinlock
- How to Use Busy Waiting
Thread Patterns
Multiprocessing Learning Path
Python provides process-based concurrency in the “multiprocessing” module.
This section provides a learning path that you can use to get started and get effective with the multiprocessing module, super fast.
- Step 1: Discover what a process is in Python.
- Step 2: Discover how to run code in a new child process.
- Step 3: Discover how get the most out of processes.
Next, you can browse all tutorials or dive into a topic below to learn more.
Configure Processes
Basic Processes
- Main Process in Python
- Main Thread of Process
- Get Process By Name
- How to Get the Process PID
- Get the Number of CPUs
- Process Utility Functions
- How to Query Process Status
- How to Restart a Process
- How to Join a Process
Intermediate
- Why Not Always Use Processes
- Multiprocessing Best Practices
- Multiprocessing Logging
- Threads in Processes
- Automatically Start Processes
- Return Value From Process
Advanced Processes
- Multiprocessing Context
- Multiprocessing Freeze Support
- Inherit Global Variables
- Shared ctypes in Python
Process Safety
Parents and Children
Sync Primitives
- Multiprocessing Lock
- Multiprocessing RLock
- Multiprocessing Event Object
- Multiprocessing Semaphore
- Multiprocessing Condition Var
- Multiprocessing Barrier
Queues and Pipes
Failure Modes
- Common Multiprocessing Errors
- Add if __name__ == ‘__main__’
- Fix FileNotFoundError
- Shared Process Class Attributes
Killing Processes
ThreadPoolExecutor Learning Path
Python provides thread pool-based concurrency with the “ThreadPoolExecutor” class.
This section provides a learning path that you can use to get started and get effective with the ThreadPoolExecutor class, super fast.
- Step 1: Discover the ThreadPoolExecutor class in Python.
- Step 2: Discover how to run code in the ThreadPoolExecutor.
- Step 3: Discover how get the most out of ThreadPoolExecutor.
Next, you can browse all tutorials or dive into a topic below to learn more.
Configure
- Configure Max Workers
- How to Configure Thread Names
- Worker Initializer Functions
- How to Use the Context Manager
Basics
- map() vs. submit()
- wait() vs. as_completed()
- Common Usage Patterns
- Wait For The First Task To Finish
- Wait For All Tasks to Finish
- How To Get Task Results
- How to Check Task Status
- How to Add a Callback to a Task
Intermediate
Comparisons
- ThreadPoolExecutor vs. Thread
- ThreadPoolExecutor vs. GIL
- ThreadPoolExecutor vs. AsyncIO
- ThreadPoolExecutor vs. PPE
Advanced
- How to Limit Pending Tasks
- How to Retry Failed Tasks
- How to Stop All Tasks if Task Fails
- How to Submit a Follow-up Task
- ThreadPoolExecutor Thread-Safe
- How To Identify Deadlocks
Failure Modes
Example Applications
ProcessPoolExecutor Learning Path
Python provides process pool-based concurrency with the “ProcessPoolExecutor” class.
This section provides a learning path that you can use to get started and get effective with the ProcessPoolExecutor class, super fast.
- Step 1: Discover the ProcessPoolExecutor class in Python.
- Step 2: Discover how to run code in the ProcessPoolExecutor.
- Step 3: Discover how get the most out of ProcessPoolExecutor.
Next, you can browse all tutorials or dive into a topic below to learn more.
Configure
- Configure Max Workers
- Config Worker Initialize Function
- How to Use The Context Manager
- Config Multiprocessing Context
Basics
- map() vs submit()
- wait() vs as_completed()
- Common Usage Patterns
- How to Wait For The First Result
- How to Wait For a Task to Finish
- How to Get Results
- How to Check the Status of a Task
- How to Add a Callback to a Task
Intermediate
Multiprocessing Pool Learning Path
Python provides process pool-based concurrency with the “multiprocessing.Pool” class.
This section provides a learning path that you can use to get started and get effective with the multiprocessing.Pool class, super fast.
- Step 1: Discover the multiprocessing.Pool class in Python.
- Step 2: Discover how to run code in the multiprocessing.Pool.
- Step 3: Discover how get the most out of multiprocessing.Pool.
- Pool in Python: The Complete Guide (coming soon)
- Python Multiprocessing Pool Jump-Start (my book)
Next, you can browse all tutorials on this topic.
Configure
- Config num workers
- Use worker initalizer
- Config max tasks per child
- Config pool context
- How to configure
Basics
Intermediate
- Stop all tasks
- Kill all tasks
- Get all worker PIDs
- Get all worker names
- Get all thread details
- Tasks fail silently
Advanced
Use with Primitives
Issue Tasks
Concurrent File I/O Learning Path
Working with files can be slow.
This section provides a learning path that you can use to get started and get effective at using Python concurrency to speed-up file I/O operations, super fast.
- Step 1: Discover Python concurrency techniques.
- Step 2: Discover Python file I/O operations.
- Step 3: Discover how to perform file I/O concurrently.
- Multithreaded File Saving in Python
- Multithreaded File Loading in Python
- Multithreaded File Deletion in Python
- Multithreaded File Copying in Python
- Multithreaded File Moving in Python
- Multithreaded File Renaming in Python
- Multithreaded File Appending in Python
- Multithreaded File Unzipping in Python
- Multithreaded File Zipping in Python
Next, you can browse all tutorials on this topic.
Guides
Sometimes an extensive guide on a specific topic is required.
This section lists large guides on specific topics that may help.
Complete Guides
- Threading in Python: The Complete Guide
- Multiprocessing in Python: The Complete Guide
- ThreadPoolExecutor in Python: The Complete Guide
- ProcessPoolExecutor in Python: The Complete Guide
- Multiprocessing Pool in Python: The Complete Guide (coming soon)
Other Guides
- Python Concurrency Learning Paths
- Choose a Python Concurrency API
- Python Concurrency Books
- Python Concurrency Glossary
Need More Help?
Do you need more help with Python concurrency?
Perhaps you need help with a topic not covered above?
- Contact me directly and I will do my best to help.