Hacker News new | past | comments | ask | show | jobs | submit login
Stop worrying about blocking: the new async-std runtime for Rust, inspired by Go (async.rs)
12 points by Argorak on Dec 16, 2019 | hide | past | favorite | 2 comments



> 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!


> 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...

> 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 ;).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: