"What is a Coroutine Anyway?" - John Reese (North Bay Python 2019)

2019 ж. 3 Қар.
24 872 Рет қаралды

John Reese
2019.northbaypython.org/sched...
This talk will start with basic concepts of functions, including how they are represented in memory, how state is tracked, and how function calls interact with the stack. We’ll then cover the common methods of running multiple functions concurrently, as well as the benefits and difficulties of concurrency in Python.
We’ll then introduce the concept of coroutines, a variant of functions, and discuss how coroutines manage state and execution differently from functions. We’ll show some high level examples of coroutines that communicate with each other, and look at how they can be of use for I/O bound workloads.
Then we’ll finish by showing how coroutines are implemented in Python, what the async/await keywords are actually doing when you use them in your code, and how all of these concepts are leveraged by the AsyncIO framework to build high performance applications in modern, clean Python.
AsyncIO uses coroutines to deliver high performance from a single thread. But coroutines can be mysterious. How do they work? Starting from first principles, we’ll take a look at the basic concepts of coroutines and the unique problems they solve, then finish by deconstructing the core pieces of the AsyncIO framework.
This talk is for developers of all backgrounds. No CS degree required!
A Python conference north of the Golden Gate
North Bay Python is a single-track conference with a carefully curated set of talks representing the diverse Python community and their different areas of interest.
If a topic is less to your interest, or you've met some people you really want to sit down and chat with, we'll have plenty of areas away from the main theatre to catch up and chat.
Our goal is to keep prices as low as possible. That means we won't be catering lunch. Instead, you can look forward to extra-long lunch breaks you can use to explore all of the great food options around the venue.
Produced by NDV: / @nextdayvideo
Sun Nov 3 14:00:00 2019 at Mystic Theatre

KZhead