Threads vs Async: Has Asyncio Solved Concurrency?
Channel: PyCon South Africa
Date: 2020-10-21

by Jacob Unna

At: PyConZA 2020
https://2020.za.pycon.org/talks/13-threads-vs-async-has-asyncio-solved-concurrency/

In recent years [asyncio](https://docs.python.org/3/library/asyncio.html) has garnered much attention as a faster and easier alternative to threads. So do threads still have a place in the world? And what of other concurrency tech such as [greenlets](https://greenlet.readthedocs.io/en/latest/)?

The fundamental problem solved by both async frameworks and threads is one of _scheduling_. This talk will put aside nitty gritty implementation details and go back to basics, examining how a _cooperative scheduler_ (used by async frameworks) differs from a _preemptive scheduler_ (used by threads). This basic understanding will clarify what is often considered a tricky subject and shed light on the pros and cons of each approach.

We will also see that even having decided on the async model, asyncio is not the only tool available. We will explore the pros and cons of  [greenlets](https://greenlet.readthedocs.io/en/latest/), [curio](https://curio.readthedocs.io/en/latest/) and [trio](https://trio.readthedocs.io/en/stable/) as alternatives to the standard library's solution.

This talk is suitable for all levels from beginner to expert. The format will be simple and intuitive, with basic live examples of how to use threads and asyncio to do everyday tasks. You will come away not with an encyclopaedic knowledge of a specific toolchain, but with a deeper appreciation of the core concepts that power concurrency.

Room: Video Room 2
Scheduled start: 2020-10-08 14:45:00