Back to Browse

Using Coroutines with Boost.Cobalt

1.2K views
Sep 19, 2024
1:23:39

ast month, we looked at the basics of coroutines in C++20. This month, Richard Thomson will give us an introduction to the Boost.Cobalt library that aims to make using coroutines simpler. Boost.Cobalt by Klemens Morgenstern was released in December, 2023 as part of the 1.84 version of the Boost Libraries. Klemens describes the motivation for Cobalt here: "Many languages programming languages like node.js and python provide easy to use single-threaded concurrency frameworks. While more complex than synchronous code, single threaded asynchronicity avoids many of the pitfalls & overhead of multi-threading. [...] This library is meant to provide this to C++: simple single threaded asynchronicity akin to node.js and asyncio in python that works with existing libraries like boost.beast, boost.mysql or boost.redis. It based on boost.asio." We'll start by taking a look at the basics of Cobalt using the examples provided in the documentation. We'll finish off by switching to Cobalt for our JSON comics database. Meetup: https://www.meetup.com/utah-cpp-programmers Past topics: https://utahcpp.wordpress.com/past-meeting-topics/ Future topics: https://utahcpp.wordpress.com/future-meeting-topics/ Sample code: https://github.com/LegalizeAdulthood/cobalt-comics

Download

1 formats

Video Formats

360pmp4123.3 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Using Coroutines with Boost.Cobalt | NatokHD