C++20 coroutines on microcontrollers - what we learned

Belson, Bruce, Xiang, Wei, Holdsworth, Jason, and Philippa, Bronson (2021) C++20 coroutines on microcontrollers - what we learned. IEEE Embedded Systems Letters, 13 (1). pp. 9-12.

[img] PDF (Published Version) - Published Version
Restricted to Repository staff only

View at Publisher Website: https://doi.org/10.1109/LES.2020.2973397
 
2
5


Abstract

Coroutines will be added to C++ as part of the C++20 standard. Coroutines provide native language support for asynchronous operations. This study 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-M4microcontroller 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 analysed the impact of these language features on prototypical IoT 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.

Item ID: 65706
Item Type: Article (Research - C1)
ISSN: 1943-0671
Keywords: C++, coroutines, embedded software, Internet of Things (IoT), microcontrollers
Related URLs:
Copyright Information: © 2020 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission
Date Deposited: 03 Mar 2021 01:48
FoR Codes: 46 INFORMATION AND COMPUTING SCIENCES > 4612 Software engineering > 461204 Programming languages @ 50%
40 ENGINEERING > 4009 Electronics, sensors and digital hardware > 400907 Industrial electronics @ 50%
SEO Codes: 97 EXPANDING KNOWLEDGE > 970109 Expanding Knowledge in Engineering @ 100%
Downloads: Total: 5
More Statistics

Actions (Repository Staff Only)

Item Control Page Item Control Page