This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: For which gcc release is going to be foreseen the support for the Coroutines TS extension?
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: gcc at gcc dot gnu dot org,Nathan Sidwell <nathan at acm dot org>,Iain Sandoe <idsandoe at googlemail dot com>,Sebastian Huber <sebastian dot huber at embedded-brains dot de>
- Cc: GCC <gcc at gcc dot gnu dot org>
- Date: Tue, 20 Aug 2019 17:54:28 +0200
- Subject: Re: For which gcc release is going to be foreseen the support for the Coroutines TS extension?
- References: <CAFegzBQVDrywxU14-YTC5Jw2fxksyPmQcc0omMMWHOjv4-+m_w@mail.gmail.com> <CAH6eHdQtY+ANHatqYugCZsY7vEj=kjowQqe8rseotWb8x50FzQ@mail.gmail.com> <ad2f018a-3f35-0041-2be1-8cca7be90005@redhat.com> <68aa9c80-0ccc-19d2-363c-82a444c628f5@embedded-brains.de> <87lfwlcfvb.fsf@oldenburg2.str.redhat.com> <75F0CC8E-8255-4A0C-9D14-AA1A6349440D@googlemail.com> <a3f826ac-ca56-d63f-39ae-346b1752ebf1@acm.org>
On August 20, 2019 5:19:33 PM GMT+02:00, Nathan Sidwell <nathan@acm.org> wrote:
>On 7/26/19 6:03 AM, Iain Sandoe wrote:
>> Hello Sebastian,
>>
>>> On 26 Jul 2019, at 10:19, Florian Weimer <fweimer@redhat.com> wrote:
>
>>> C++ coroutines are stackless. I don't think any new low-level
>run-time
>>> 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
>system
>> or in a single-threaded environment.
>>
>> Two places I see them as being a go-to facility in embedded systems
>are:
>> * 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
>while
>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...
Richard.
>nathan