• ptu@sopuli.xyz
    link
    fedilink
    arrow-up
    4
    ·
    6 hours ago

    So all items in the array are launched simultaneuously and ran in parallel instead of sequentially?

    • scrion@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      4 hours ago

      They are launched sequentially, but run simultaneously, yes - at least some of them. And they run concurrently but not in parallel - using a single execution context, there is only a single thread, so no parallelism exist.

      • ptu@sopuli.xyz
        link
        fedilink
        arrow-up
        1
        ·
        3 hours ago

        I see, I was only aware of sleep but that makes sense. Thanks for your insight.