News for hackers. Stuff that matters.
Re:Async Rust in Three Parts by the__alchemist on Wednesday October 23, 2024 @11:47PM (#41931714)
I notice this as well; there is a false dichotomy of "Async/Await" or "blocking". I see this in embedded too. I think a lot of rust embedded programmers learned on Embassy, and to them, not using Async means blocking.
Re:Async Rust in Three Parts by zavec on Wednesday October 23, 2024 @11:57PM (#41931766)
Is the alternative the more traditional spawning threads and using channels, or is there another paradigm? That's definitely something I'd be interested in learning more about.
Re:Async Rust in Three Parts by onjectic on Thursday October 24, 2024 @02:10AM (#41932426)
I think they mean that there is more than one asynchronous paradigm. Actors is one alternative I can think of.
Re:Async Rust in Three Parts by palata on Thursday October 24, 2024 @03:58AM (#41933172)
Where an actor has its own thread and communicates with a channel, right?
Re:Async Rust in Three Parts by pdimitar on Thursday October 24, 2024 @07:00AM (#41934286)
Not necessarily, a lot of actors can be sharing the same OS thread and be preemptively switched away from when they hit a certain limit of instructions or start an I/O call. Erlang demonstrates this very well because it works there without a glitch 99.99% of the time (and the remaining 0.01% are because of native code that does not yield control).
Re:Async Rust in Three Parts by GolDDranks on Thursday October 24, 2024 @04:37AM (#41933422)
There is also readyness-based polling in a loop, without the async/await sugar.
Re:Async Rust in Three Parts by omani on Wednesday October 23, 2024 @11:53PM (#41931745)
can you elaborate on this?
Re:Async Rust in Three Parts by the__alchemist on Thursday October 24, 2024 @08:55AM (#41935028)
Writing programs that perform multiple tasks asynchronously can be done in many ways. It is a broad and important tool in software, and the Async/Await language is only one way to do it. Examples:

  - Multiple cores
  - DMA or other dedicated hardware
  - GPU programming
  - Distributed systems (e.g. the CAN network in your car)
  - Threads
  - Interrupts
  - Event loops
  - Coroutines