TGViewer
C++ - Reddit C++ - Reddit @r_cpp · 230 subscribers
Post #25789 6
It annoys me that coroutines are described as "functions that can be suspended"

Any function can be suspended. It literally happens constantly when a process or thread gets pre-empted by the OS or asynchronous hardware, with the stack being the mechanism to save to and restore context from. So, this super common way of describing coroutines is just frustrating because it's not it!

Coroutines are functions that can be suspended in a **controlled, intentional (as in, explicitly expressed) way**, with the relevant context (coroutine frame) being placed _not_ on the stack like a function's usual context, but on the heap (usually).

I wish someone had broken it down for me in this way before, so hopefully it helps someone else too.

https://redd.it/1wgm4jx
@r_cpp
Reddit From the cpp community on Reddit Explore this post and more from the cpp community
More from @r_cpp
  1. Oct 6, 2026==2896379== logger no timeout configured, using default 1000 ms ==2896379== ==2896379== HE…
  2. Oct 6, 2026No, -Wall -Werror Does Not Guarantee Detection of Conditionally Uninitialized Local Variab…
  3. Oct 6, 2026C++20 modules support: 228 projects already available to be consumed Hello everyone. I che…
  4. Oct 6, 2026operator<>: A Dream of Higher-order Metaprogramming Parity https://www.elbeno.com/blog/?p=…
  5. Oct 6, 2026University of Waterloo user study on understanding CMake changes Hi everyone, I’m Mattie N…
  6. Oct 6, 2026Try to Implement Reflection Annotations in C++20 https://typecombinator.github.io/en/posts…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →