This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: For which gcc release is going to be foreseen the support for the Coroutines TS extension?

On August 20, 2019 5:19:33 PM GMT+02:00, Nathan Sidwell <> wrote:
>On 7/26/19 6:03 AM, Iain Sandoe wrote:
>> Hello Sebastian,
>>> On 26 Jul 2019, at 10:19, Florian Weimer <> wrote:
>>> C++ coroutines are stackless.  I don't think any new low-level
>>> support will be needed.
>> correct, C++20 coroutines and threading mechanisms are orthogonal
>> facilities; one can use (IS C++20) coroutines on top of a threaded
>> or in a single-threaded environment.
>> Two places I see them as being a go-to facility in embedded systems
>>   * co-operative multi-tasking UIs on single-threaded platforms.
>>   * async I/O completion by continuations, rather than callbacks.
>There are cases where the overhead of threads is too expensive.  For 
>instance hiding (cache-missing) load latencies by doing other work
>waiting -- a context switch at that point is far too expensive.

But are coroutines so much lower latency (and a context switch does not involve cache misses on its own?). For doing useful work in this context CPU designers invented SMT... 



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]