Skip to Content
C++ High Performance - Second Edition
book

C++ High Performance - Second Edition

by Björn Andrist, Viktor Sehr
December 2020
Intermediate to advanced
544 pages
12h 45m
English
Packt Publishing
Content preview from C++ High Performance - Second Edition

13

Asynchronous Programming with Coroutines

The generator class implemented in the previous chapter helped us to use coroutines for building lazily evaluated sequences. C++ coroutines can also be used for asynchronous programming by having a coroutine represent an asynchronous computation or an asynchronous task. Although asynchronous programming is the most important driver for having coroutines in C++, there is no support for asynchronous tasks based on coroutines in the standard library. If you want to use coroutines for asynchronous programming, I recommend you find and use a library that complements C++20 coroutines. I've already recommended CppCoro (https://github.com/lewissbaker/cppcoro), which at the time of writing seems like the most ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C++ High Performance

C++ High Performance

Viktor Sehr, Björn Andrist

Publisher Resources

ISBN: 9781839216541Supplemental Content