you are viewing a single comment's thread
view the rest of the comments
[–] 57 points 2 years ago* (last edited 2 years ago) (9 children)

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.

  • source
  • parent
  • hideshow 9 child comments
  • [–] 7 points 2 years ago (3 children)

    Exactly.

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

  • source
  • parent
  • hideshow 3 child comments
  • [–] 3 points 2 years ago (2 children)

    Which language? Usually there's a thread pool where multiple tasks are run in parallel. CPython is a special case due to gil, but we have pypy which has actual parallelism

  • source
  • parent
  • hideshow 2 child comments
  • [–] 1 point 2 years ago (1 child)

    I've only ever used it in those lua microcontrollers and in Rust with the async keyword.

    In lua I doubt they use proper threading due to the GIL. Rust probably can do async with threads, but it just wasn't fun to work with.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 3 points 2 years ago (1 child)

    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.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 2 points 2 years ago (1 child)

    A lot of languages have an asunc/await facade for tasks run on a background thread for result (c#, clj, py, etc), but it's certainly not the default anywhere, and go most goroutines(?)/other csp implementations are probably going to be yielding for some io most of the time at the bottom anyway

  • source
  • parent
  • hideshow 1 child comment