C++20 Coroutines on Microcontrollers—What We Learned
Autor: | Bronson Philippa, Bruce Belson, Wei Xiang, Jason Holdsworth |
---|---|
Rok vydání: | 2021 |
Předmět: |
General Computer Science
business.industry Computer science Programming language Coroutine 020207 software engineering Context (language use) 02 engineering and technology computer.software_genre 020202 computer hardware & architecture Microcontroller Memory management Software Control and Systems Engineering Asynchronous communication 0202 electrical engineering electronic engineering information engineering State (computer science) business computer Context switch |
Zdroj: | IEEE Embedded Systems Letters. 13:9-12 |
ISSN: | 1943-0671 1943-0663 |
Popis: | 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. |
Databáze: | OpenAIRE |
Externí odkaz: |