Re:C++20: Building a Thread-Pool with Coroutines
by ninepoints on Saturday May 22, 2021 @09:23PM
(#27251697)
You're missing the big idea a bit. Coroutines in C++ can be used to implement generators or goroutines or async/await, etc. They are intended for library authors as a lower level construct. See for example: https://www.jeremyong.com/cpp/2021/01/04/cpp20-coroutines-a-...
[ Parent
| on HN ]
Re:C++20: Building a Thread-Pool with Coroutines
by cletus on Saturday May 22, 2021 @11:07PM
(#27252102)
I literally said this at the end of my comment about coroutines being a low-level primitive.
Re:C++20: Building a Thread-Pool with Coroutines
by dundarious on Saturday May 22, 2021 @11:29PM
(#27252184)
You raised two hypotheticals and said you honestly don't know if either/both/neither are true.
1. Is it like Python generators?
2. Is it a bad example of design by committee and meant as a set of lower level primitives?
GP responded that 2 is correct (but without the sass on design by committee) and that 2 allows for them to implement such things as 1.
I think they gave their opinion as to what parts of your hypotheticals are true, and that is a valuable contribution, and very much not the same as just repeating parts of your comment ("I literally said this").