Announcement

Collapse
No announcement yet.

GCC 11 Enables Co-Routines Support In C++20 Mode

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    Originally posted by ssokolow View Post
    Whether they run in parallel (they execute concurrently by definition) depends on the implementation.
    well, just like ordinary functions could be run in parallel if someone will run them in parallel. which doesn't make ordinary functions threads and it doesn't make coroutines threads

    Comment


    • #32
      Originally posted by bug77 View Post
      Actually, coroutines do run concurrently, they just don't run in parallel. But I'm just posting this for correctness' sake, I frequently mix those two up myself.
      well, the only thing they do concurrently is wait. do you consider normal function to be running concurrently with its caller?
      Last edited by pal666; 05-20-2020, 08:56 AM.

      Comment


      • #33
        Originally posted by pal666 View Post
        well, just like ordinary functions could be run in parallel if someone will run them in parallel. which doesn't make ordinary functions threads and it doesn't make coroutines threads
        Of course not. My point is that whether they are run in parallel and under what circumstances is an implementation-dependent detail.

        Fundamentally, they are a form of M:N cooperative multi-threading (while what we think of as threading today is 1:1 pre-emptive multi-threading), and some implementations set M to 1 (implemented on top of a single thread).
        Last edited by ssokolow; 05-21-2020, 04:38 AM.

        Comment

        Working...
        X