public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Richard Biener <richard.guenther@gmail.com>
Cc: gcc@gcc.gnu.org, Nathan Sidwell <nathan@acm.org>,
	Iain Sandoe <idsandoe@googlemail.com>,
	Sebastian Huber <sebastian.huber@embedded-brains.de>
Subject: Re: For which gcc release is going to be foreseen the support for the Coroutines TS extension?
Date: Tue, 20 Aug 2019 16:15:00 -0000	[thread overview]
Message-ID: <87wof7lsoq.fsf@oldenburg2.str.redhat.com> (raw)
In-Reply-To: <35DC8BFA-112B-4E2C-BF4F-CEBDF62DDCC5@gmail.com> (Richard	Biener's message of "Tue, 20 Aug 2019 17:54:28 +0200")

* Richard Biener:

> 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...

I think the idea is that you don't have to worry about synchronizing
multiple threads to reap the benefits from hardware parallelism.  For
hiding memory access latency, that could be important because the
synchronization overhead could easily eat up any potential benefits.

Thanks,
Florian

  reply	other threads:[~2019-08-20 16:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-04 17:32 Marco Ippolito
2018-06-04 17:36 ` Jonathan Wakely
2018-06-06  7:14   ` Florian Weimer
2019-07-26  8:54     ` Sebastian Huber
2019-07-26  9:19       ` Florian Weimer
2019-07-26 10:03         ` Iain Sandoe
2019-08-20 15:19           ` Nathan Sidwell
2019-08-20 15:54             ` Richard Biener
2019-08-20 16:15               ` Florian Weimer [this message]
2019-08-21 12:29                 ` Iain Sandoe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wof7lsoq.fsf@oldenburg2.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=idsandoe@googlemail.com \
    --cc=nathan@acm.org \
    --cc=richard.guenther@gmail.com \
    --cc=sebastian.huber@embedded-brains.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).