• qqq@lemmy.world
    link
    fedilink
    English
    arrow-up
    55
    ·
    edit-2
    1 year ago

    Async features in almost all popular languages are a single thread running an event loop (Go being an exception there I believe). Multi threading is still quite difficult to get right if the task isn’t trivially parallelizable.

    • vext01@lemmy.sdf.org
      link
      fedilink
      English
      arrow-up
      7
      arrow-down
      2
      ·
      1 year ago

      Exactly.

      Also every time I’ve used async stuff, I’ve pined for proper threads. Continuation spaghetti isn’t my bag.

    • Gnome Kat@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 year ago

      My goto for easy multi threading is lock free queues. Generate work on one thread and queue it up for another thread to process. Easy message passing and stuff like that. It doesn’t solve everything but it can do a lot if you are creative with them. As long as you maintain a single thread ownership of memory and just pass it around the threads via message passing on queues, everything just sorta works out.