• arendjr@programming.dev
    link
    fedilink
    arrow-up
    6
    ·
    8 months ago

    Usually your coroutines (should) all spin up at the very start and all stay running for the entire app lifetime.

    That’s an interesting perspective. At that point, what is even the point of coroutines over using threads? I thought the main reason for their existence was being lightweight enough to spin up whenever, wherever you need.

    • UQuark@programming.dev
      link
      fedilink
      arrow-up
      4
      ·
      8 months ago

      From the article, it seems that coroutines and “green threads” (e.g. goroutines and lua coroutines) are quite different things. As far as I understood, coroutines are just a way to pause/resume operation while retaining local scope state