C++ Coroutines and Structured Concurrency in Practice - Dmitry Prokoptsev - CppCon 2024

Channel

https://cppcon.org
---

C++ Coroutines and Structured Concurrency in Practice - Dmitry Prokoptsev - CppCon 2024
---

C++20 coroutines present some exciting opportunities for organizing and simplifying concurrent logic, but they have proven challenging to integrate with production systems. Object lifetime and execution order issues can be difficult to manage, especially without guidance from well-established best practices. Practical use requires interoperability with existing event loops and with non-coroutine-aware components. While some experimental libraries have started to be released, the C++ “async ecosystem” is still young compared to many other languages.

We will describe our path through this thicket and introduce Corral, a new open-source concurrency framework for C++ that attempts to tame it. Corral is built around structured concurrency principles, so lifetimes and control flow are easier to reason about. It does not provide any opinionated I/O layer, so it can work with the one you’re already using, or with a standard such as Boost.Asio. We have ported a number of our I/O-bound production processes to use this system, and have found the modernized versions to be substantially simpler with fewer weird bugs.

This talk is geared towards C++ developers who have some familiarity with coroutines but have found them challenging to work with. We will delve into the architectural design of our framework, offering insights that may be useful to others with similar needs. Special emphasis will be placed on practical aspects such as task cancellation, timeouts, and integration with legacy code. We will also share a few design patterns we’ve discovered after two years of production use.
---

Slides: https://github.com/CppCon/CppCon2024/blob/main/Presentations/Coroutines…

Sponsored by JetBrains: https://www.jetbrains.com/clion/
---

Dmitry Prokoptsev

Dmitry has been using C++ in his routine work for 17 years, mostly focusing on complex asynchronous I/O-bound applications. After working in companies like Yandex and Google, he joined Hudson River Trading, a quantitative trading firm in New York, where he develops and improves research infrastructure, and also keeps people entertained by bringing last additions to C++ to the code base.
---

CppCon is the annual, week-long face-to-face gathering for the entire C++ community. The conference is organized by the C++ community for the community. You will enjoy inspirational talks and a friendly atmosphere designed to help attendees learn from each other, meet interesting people, and generally have a stimulating experience. Taking place this year in Aurora, Colorado, near the Denver airport, and including multiple diverse tracks, the conference will appeal to anyone from C++ novices to experts.
Annual CppCon Conference - https://www.cppcon.org
https://www.linkedin.com/company/cppcon
https://x.com/cppcon
https://www.facebook.com/CppConference
https://www.reddit.com/r/cppcon/
https://mastodon.social/@CppCon
---

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd: https://events.digital-medium.co.uk
---

#concurrency #cpp #cplusplus #cppcon #cppprogramming #cplusplusprogramming #softwaredevelopment #softwareengineering #coding #code #computerscience #technology #programming #programmer