Coroutines Comunications. Design and Implementation Issues in C++20

  • Radu Lupșa Department of Computer Science, Babes-Bolyai University, 1, M. Kogalniceanu Street, 400084, Cluj-Napoca, Romania
  • Dana Lupșa Department of Computer Science, Babes-Bolyai University, 1, M. Kogalniceanu Street, 400084, Cluj-Napoca, Romania

Abstract

This paper explores the communication mechanisms and patterns available to coroutines to cooperate with one another. It investigates the issues in designing and implementing a framework for using C++20 coroutines effectively, for generators, asynchronous function calls, and especially asynchronous generators.

References

[1] C and c++ reference, coroutines. https://en.cppreference.com/w/cpp/language/coroutines. Accessed: 2022.
[2] A library of c++ coroutine abstractions for the coroutines ts. https://github.com/lewissbaker/cppcoro. Accessed: 2022.
[3] Pep 525 – asynchronous generators. https://peps.python.org/pep-0525/ . Accessed: 2022.
[4] .NET/C# guide/language reference. await operator - asynchronously await for a task to completes. https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/await. Accessed: 2022.
[5] .NET/C# guide/language reference. yield statement - provide the next element. https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/yield. Accessed: 2022.
[6] Windows app development documentation. processes and threads. fibers. https://learn.microsoft.com/en-us/windows/win32/procthread/fibers. Accessed: 2022.
[7] Belson, B., Xiang, W., Holdsworth, J. J., and Philippa, B. W. C++20 coroutines on microcontrollers—what we learned. IEEE Embedded Systems Letters 13 (2021), 9–12.
[8] Chauhan, K., Kumar, S., Sethia, D., and Alam, M. N. Performance analysis of kotlin coroutines on android in a model-view-intent architecture pattern. In 2021 2nd International Conference for Emerging Technology (INCET) (2021), IEEE, pp. 1–6.
[9] Conway, M. E. Design of a separable transition-diagram compiler. Commun. ACM 6, 7 (jul 1963), 396–408.
[10] Elizarov, R., Belyaev, M., Akhin, M., and Usmanov, I. Kotlin coroutines: Design and implementation. In Proceedings of the 2021 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software (2021), Association for Computing Machinery, p. 68–84.
[11] Ierusalimschy, R. Programming in Lua, 2003.
[12] Marlin, C. D. Coroutines: A Programming Methodology, a Language Design and an Implementation, vol. 95 of Lecture Notes in Computer Science. Springer, 1980.
[13] Moura, A. L. D., and Ierusalimschy, R. Revisiting coroutines. ACM Trans. Program. Lang. Syst. 31, 2 (feb 2009).
[14] von Merzljak, L., Fent, P., Neumann, T., and Giceva, J. What are you waiting for? use coroutines for asynchronous I/O to hide I/O latencies and maximize the read bandwidth! In International Workshop on Accelerating Data Management Systems (ADMS) (2022).
[15] Wang, Z. Web crawler scheduler based on coroutine. 2019 International Conference on Intelligent Computing, Automation and Systems (ICICAS) (2019), 540–543.
Published
2023-04-08
How to Cite
LUPȘA, Radu; LUPȘA, Dana. Coroutines Comunications. Design and Implementation Issues in C++20. Studia Universitatis Babeș-Bolyai Informatica, [S.l.], v. 67, n. 2, p. 37-48, apr. 2023. ISSN 2065-9601. Available at: <https://www.cs.ubbcluj.ro/~studia-i/journal/journal/article/view/82>. Date accessed: 20 apr. 2024. doi: https://doi.org/10.24193/subbi.2022.2.03.
Section
Articles