Python Concurrency Books

Python Concurrency Books

Python provides thread-based concurrency in the threading module, as well as process-based concurrency in the multiprocessing module and coroutine-based concurrency in the asyncio module.

Choosing the right type of concurrency is tricky and this guide may help.

Books provide an affordable and effective approach to learning Python concurrency at your own pace.

This page provides a complete and up-to-date list of all books that cover Python concurrency, as well as helpful books on related topics. I own a copy or have digital access to all of the books listed.

All books are linked on Amazon. When you buy a book through my links, I may earn a commission.

If you know of a book to add to this page, please let me know.

Python Concurrency Books
Python Concurrency Books

Best Python Concurrency Books

There are a number of books on Python concurrency, although this section focuses on a small subset that I recommend.

In short, they are:

  1. High Performance Python
  2. Using Asyncio in Python
  3. Python Concurrency with asyncio
  4. Effective Python
  5. Python Cookbook
  6. Python in a Nutshell

Let's take a closer look at each in turn.

High Performance Python

This is perhaps the best book on high-performance Python that has excellent chapters on Python concurrency.

This is the second edition of the book, the first was published in 2014.

It is all about making Python code run faster, with a focus on CPU-bound tasks.

While this book is primarily aimed at people with CPU-bound problems, we also look at data transfer and memory-bound solutions. Typically, these problems are faced by scientists, engineers, quants, and academics.

It is published by O'Reilly and is probably the current definitive book on high-performance Python for intermediate developers.

This book is meant for intermediate to advanced Python programmers. Motivated novice Python programmers may be able to follow along as well, but we recommend having a solid Python foundation.

See below for a photo of me holding the book. Notice all the yellow stick tabs I've added to my copy of the book.

High Performance Python
Photo of me holding my copy of "High Performance Python".

This is not a book dedicated to Python concurrency, but there are two chapters that I recommend, they are:

The detailed contents of Chapter 8 is as follows:

The detailed contents of Chapter 9 is as follows:

The code for the book is available on GitHub here:

Grab a copy of High Performance Python.

Using Asyncio in Python

This might have been the first book on asyncio. It is short, but effective at getting you up to speed with this relatively new approach to concurrency in Python.

This too is a second edition, the first edition was published in 2018.

It is another O'Reilly book, but at 163 pages, I would not call it the definitive book on the topic.

This book is laser-focused on getting you up-to-speed on asyncio and where you might be able to use it in your projects.

The new Asyncio features are not going to radically change the way you write programs. They provide specific tools that make sense only for specific situations; but in the right situations, asyncio is exceptionally useful. In this book, we’re going to explore those situations and how you can best approach them by using the new Asyncio features.

A helpful summary of the table of contents is as follows:

The (unofficial?) code examples from the book are available on GitHub here:

Grab a copy of Using Asyncio in Python.

Python Concurrency with asyncio

This is a newer and perhaps more complete treatment of asyncio published by Manning.

I like the modern crop of Manning technical books, and this book is no exception.

The new asyncio module is challenging to understand. This book is focused on helping newer Python developers get started with asyncio.

My motivation for writing this book was to fill this gap that exists in the Python landscape on the topic of concurrency, specifically with asyncio and single-threaded concurrency. I wanted to make the complex and under-documented topic of single-threaded concurrency more accessible to developers of all skill levels.

I like that it it has many different types of worked examples, see the table of contents to see what I mean:

The code examples are available on GitHub here:

Grab a copy of Python Concurrency with asyncio.

Effective Python

I think this might be the best Python recipe book out there. I love this book and it has an excellent chapter on concurrency.

This is the second edition of the book, the first was published in 2015.

The book is published by Addison-Wesley and is no joke.

The examples are useful, effective, and impressive. It's the must-read book for developers coming to Python from other languages to learn the pythonic way of doing things.

This book provides insight into the Pythonic way of writing programs: the best way to use Python. It builds on a fundamental understanding of the language that I assume you already have. Novice programmers will learn the best practices of Python’s capabilities. Experienced programmers will learn how to embrace the strangeness of a new tool with confidence.

I recommend Chapter 7, which contains 13 recipes on multithreading and multiprocessing, as follows:

See below for a copy of me holding my copy of the book.

Effective Python
Photo of me holding my copy of "Effective Python".

The code examples from the book are available on GitHub here:

The book has an official homepage (respect!) here:

Grab a copy of Effective Python.

Python Cookbook

This is an old book now, but is a classic and written by a master of Python concurrency, David Beazley.

This is the third edition of the book and it is published by O'Reilly.

It is the definitive Python cookbook, showing you the pythonic way to solve common programming tasks.

This book is aimed at more experienced Python programmers who are looking to deepen their understanding of the language and modern programming idioms. Much of the material focuses on some of the more advanced techniques used by libraries, frameworks, and applications.

I recommend Chapter 12: Concurrency.

Python has long supported different approaches to concurrent programming, including programming with threads, launching subprocesses, and various tricks involving generator functions. In this chapter, recipes related to various aspects of concurrent programming are presented, including common thread programming techniques and approaches for parallel processing.

This chapter has help 14 recipes on multithreading and multiprocessing:

The code examples for the book are available on GitHub here:

Grab a copy of Python Cookbook.

Python in a Nutshell

This is another excellent book that covers the book broadly and provides a chapter on multithreading and multiprocessing.

This is the third edition of the book. The first edition was published in 2003 and the second edition was published in 2006. It looks like a forth edition is on its way.

This book aims to be be the definitive quick-reference to the language, as stated by the subtitle.

The book is a quick reference to Python itself, the most commonly used parts of its vast standard library, and a few of the most popular and useful third- party modules and packages

I recommend the chapters:

The contents of Chapter 14 is as follows:

The contents of Chapter 18 is as follows:

The source code examples are available on GitLab here:

Grab a copy of Python in a Nutshell.

More Python Concurrency Books

There are also many books from Packt publishing that cover Python concurrency.

They include:

  1. Advanced Python Programming
  2. Python Parallel Programming Cookbook
  3. Learning Concurrency in Python
  4. Parallel Programming with Python
  5. Mastering Concurrency in Python
  6. Python High Performance
  7. Distributed Computing with Python

Let's take a closer look at each in turn.

Advanced Python Programming

This is a general book on the topic of advanced Python programming that has many chapters on Python concurrency.

This is the second edition of the book, the first edition was published in 2019.

It is really a book on Python concurrency dressed up to be more general. The preface says as much, drawing the content on Python concurrency from "Mastering Concurrency in Python".

This Learning Path shows you how to leverage the power of both native and third-party Python libraries for building robust and responsive applications. You will learn about profilers and reactive programming, concurrency and parallelism, as well as tools for making your apps quick and efficient.

I prefer this book over the latter given it is newer and it has more content, making it better value for money.

Perhaps the most relevant chapters are:

The source code examples for the book are available on GitHub from:

Grab a copy of Advanced Python Programming.

Python Parallel Programming Cookbook

This book provides more than 70 recipes on multithreading, multiprocessing, and distributed computing in Python.

This is the second edition of the book, the first edition was published in 2015.

I like the broadness of this book, from threads, to processes, to distributed computing to GPUs.

Parallel computing, in fact, represents the simultaneous use of multiple computing resources to solve a processing problem, so that it can be executed on multiple CPUs, breaking a problem into discrete parts that can be processed simultaneously, where each is further divided into a series of instructions that can be executed serially on different CPUs.

The recipes are organised into nine chapters, they are:

I specifically recommend chapter 2, 3, and 5.

The code examples used in the book are available on GitHub:

Grab a copy of Python Parallel Programming Cookbook.

Learning Concurrency in Python

This book provides good coverage of the standard libraries as well as related third-part libraries.

Again, I like the broad nature of the examples in this book. It covers a wide range of libraries.

Throughout this book, you will learn to build highly efficient, robust, and concurrent applications. You will work through practical examples that will help you address the challenges of writing concurrent code, and also you will learn to improve the overall speed of execution in multiprocessor and multicore systems and keep them highly available.

The table of contents for this book is as follows:

The source code examples from the book are available on GitHub here:

Grab a copy of Learning Concurrency in Python.

Parallel Programming with Python

This is a short and older book with some good content.

This is a so called "mini-book", like a crash course on parallel programming with Python. It may be a bit dated by now. Nevertheless, it has good good examples if you can pick-up a cheap copy.

The first part of this work is to outline its topics. It is not easy to please everybody;
however, I believe I have achieved a good balance in the topics proposed in this mini book, in which I intended to introduce Python parallel programming combining theory and practice.

The table of contents for this book is as follows:

The source code for the examples in this book are available on GitHub here:

Grab a copy of Parallel Programming with Python.

Mastering Concurrency in Python

This book focuses on Python concurrency and covers the topic well.

This might be the best book on Python concurrency from Packt publish, if not the most complete when focused on the standard library.

We will tackle complex concurrency concepts and models via hands-on and engaging code examples. Having read this book, you will have gained a deep understanding of the principal components in the Python concurrency ecosystem, as well as a practical appreciation of different approaches to a real-life concurrency problem.

The table of contents of this book is as follows:

The code examples for the book are available on GitHub here:

Grab a copy of Mastering Concurrency in Python.

Python High Performance

This book focuses on high-performance computing with Python, but does provide a useful chapter on concurrency.

This is the second edition of the book, the first edition was published in 2013.

This is a broader book on high-performance Python, and does provide a reasonable introduction to the topic.

This book will appeal to a broad audience as it covers both the optimization of numerical and scientific codes as well as strategies to improve the response times of web services and applications. The book can be read cover-to-cover ; however, chapters are designed to be self-contained so that you can skip to a section of interest if you are already familiar with the previous topics.

The relevant parts of table of contents for the book is as follows:

The code examples from the book are available on GitHub here:

Grab a copy of Python High Performance.

Distributed Computing with Python

This book focuses on distributed computing, but does have helpful material on Python concurrency.

I like the focus on Python concurrency through the lens of distributed computing, different to practically all the other books we've looked at so far.

This book is a very practical guide for Python programmers who are starting to build their own distributed systems. It starts off by illustrating the bare minimum theoretical concepts needed to understand parallel and distributed computing in order to lay the basic foundations required for the rest of the (more practical) chapters.

The table of contents is as follows:

Grab a copy of Distributed Computing with Python.

Best General Concurrency Books

This section lists more general books on the topic of concurrency such as advanced books aimed at senior developers and textbooks aimed at students.

There are many books on concurrency specifically or on operating systems that cover concurrency.

The short-list of general concurrency books that I recommend are:

Know of an excellent general concurrency book? Please let me know.

Let's take a brief look at each in turn.

An Introduction to Parallel Programming

This book was written as a textbook for a collage-level course on broader topic of parallel programming.

It provides an introduction to writing parallel programs using MPI, Pthreads, OpenMP, and CUDA, four of the most widely used APIs for parallel programming. The intended audience is students and professionals who need to write parallel pro- grams. The prerequisites are minimal: a college-level course in mathematics and the ability to write serial programs in C.

The table of contents for this book is as follows:

The book has a companion website providing downloads of source code, slides, and figures here:

Grab a copy of An Introduction to Parallel Programming.

The Art of Multiprocessor Programming

Like the previous book, this book was written as a textbook for collage-level courses, in this case with the focus shifted from parallel programming to multiprocessor programming, e.g. restricted to one system.

In the decade since the first edition, this book has become a staple of undergraduate and graduate courses at universities around the world. It has also found a home on the bookshelves of practitioners at companies large and small. The audience for the book has, in turn, advanced the state of the art in multiprocessor programming.

The table of contents for this book is as follows:

Grab a copy of The Art of Multiprocessor Programming.

The Little Book of Semaphores

This book was written as a labor of love by the author and battle tested with many students across many universities by the author teaching the topic against early versions of the book.

It was written to allow students to practice generating solutions to concurrency problems, rather than memorizing existing solutions.

Given more time to absorb the material, students demonstrated a depth of understanding I had not seen before. More importantly, most of them were able to solve most of the puzzles. In some cases they reinvented classical solutions; in other cases they found creative new approaches.

The table of contents for this book is as follows:

The author also provides a free PDF version of the book on their website:

Grab a copy of The Little Book of Semaphores.

The Art of Concurrency

This book is designed to teach the tools of concurrency to programmers so they can start using them on their own projects, regardless of programming language.

In the past, parallel and concurrent programming was the domain of a very small set of programmers who were typically involved in scientific and technical computing arenas. From now on, concurrent programming is going to be mainstream. Parallel programming will eventually become synonymous with “programming.”

I love the glossary in this book for quickly getting a handle on terms. It inspired to write my own Python concurrency glossary.

The table of contents for this book is as follows:

Grab a copy of The Art of Concurrency.

Best Concurrency Books for Other Languages

Concurrency techniques are available for many programming languages, and sometimes the description of primitives and patterns in these other books are helpful.

This section lists some of the top books on concurrency for other programming languages, that I consult frequently.

Common Questions

This section lists common questions about concurrency books.

Do you have a question about these books?
Let me know and I may add your question and my answer to this page.

What are the Best Python AsyncIO Books?

There are two excellent books dedicated to asyncio, they are:

UPDATE: I wrote a book on Python asyncio that may help:

In fact, it did really well:

Python Asyncio Jump-Start was the #1 new release

What are the Best ThreadPoolExecutor and ProcessPoolExecutor Books?

There are no books dedicated to the ThreadPoolExecutor and the ProcessPoolExecutor.

Nevertheless, many books have a section or a chapter that covers Executors and these classes in particular.

UPDATE: I wrote a few books on Python executors that may help:

More generally, I would recommend:

What are the Best Python Threading Books?

There are no books dedicated to Python threading.

Nevertheless, all the books that cover Python concurrency generally cover threading.

UPDATE: I wrote a few books on Python threading that may help:

In fact, they did really well:

Python Threading Jump-Start was #1 new release
Python Threading Jump-Start was #1 new release

More generally, I would recommend:

What are the Best Python Multiprocessing Books?

There are no books dedicated to Python multiprocessing.

Nevertheless, all the books that cover Python concurrency generally cover multiprocessing.

UPDATE: I wrote a few books on Python multiprocessing that may help:

In fact, they did really well:

Python Multiprocessing Jump-Start was #1 new release

More generally, I would recommend: