this post was submitted on 06 Apr 2024
23 points (100.0% liked)

C++

1760 readers
1 users here now

The center for all discussion and news regarding C++.

Rules

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 6 points 6 months ago (1 children)

Usually your coroutines (should) all spin up at the very start and all stay running for the entire app lifetime.

That’s an interesting perspective. At that point, what is even the point of coroutines over using threads? I thought the main reason for their existence was being lightweight enough to spin up whenever, wherever you need.

[–] [email protected] 4 points 6 months ago

From the article, it seems that coroutines and "green threads" (e.g. goroutines and lua coroutines) are quite different things. As far as I understood, coroutines are just a way to pause/resume operation while retaining local scope state