
Stop worrying about blocking: the new async-std runtime for Rust, inspired by Go - Argorak
https://async.rs/blog/stop-worrying-about-blocking-the-new-async-std-runtime/
======
sudeepj
> should a task execute for too long

How does this work? Does the runtime tracks duration for each future?

> spawning a new executor thread

I would imagine that the future object will be moved. And for move to be cheap
are they allocated on heap by the runtime?

> The new runtime is small, uses no unsafe

Awesome!

~~~
Argorak
> How does this work? Does the runtime tracks duration for each future?

There's a watchdog. It's similar to the sysmon thread used in go:
[https://utcc.utoronto.ca/~cks/space/blog/programming/GoSched...](https://utcc.utoronto.ca/~cks/space/blog/programming/GoSchedulerAndSyscalls)

> I would imagine that the future object will be moved. And for move to be
> cheap are they allocated on heap by the runtime?

The trick is to steal the runtime on the thread, not the task being executed,
which makes the process constant time ;).

