Title
C++20 Coroutines on Microcontrollers—What We Learned
Abstract
Coroutines will be added to C++ as part of the C++20 standard. Coroutines provide native language support for asynchronous operations. This letter evaluates the C++ coroutine specification from the perspective of embedded systems developers. We find that the proposed language features are generally beneficial, but that memory management of the coroutine state needs to be improved. Our experiments on an ARM Cortex-M4 microcontroller evaluate the time and memory costs of coroutines in comparison with alternatives, and we show that context switching with coroutines is significantly faster than with thread-based real-time operating systems. Furthermore, we analyzed the impact of these language features on prototypical Internet of Things sensor software. We find that the proposed language enhancements potentially bring significant benefits to programming in C++ for embedded computers, but that the implementation imposes constraints that may prevent its widespread acceptance among the embedded development community.
Year
DOI
Venue
2021
10.1109/LES.2020.2973397
IEEE Embedded Systems Letters
Keywords
DocType
Volume
C++,coroutines,embedded software,Internet of Things (IoT),microcontrollers
Journal
13
Issue
ISSN
Citations 
1
1943-0663
0
PageRank 
References 
Authors
0.34
0
4
Name
Order
Citations
PageRank
Bruce Belson100.34
Wei Xiang263078.60
Jason Holdsworth3285.88
Bronson Philippa491.53