4 ms·
In a GitHub thread ry mentioned, "Currently async ops are executed on the same thread as the issuing Isolate - however I’m quite sure we can improve this and ex
by MehdiHK 7y ago
In a GitHub thread ry mentioned, "Currently async ops are executed on the same thread as the issuing Isolate - however I’m quite sure we can improve this and execute async ops in different threads." [1]
Is this what I think it is? Does it mean in the future I can write 'await fn()' and it'll run in a different thread? Or am I a fool and hoping too much?
[1] https://github.com/denoland/deno/issues/3003#issuecomment-534157150 https://github.com/denoland/deno/issues/3003#issuecomment-53...
- swsieber 7y agoThat's how I read it. It might happen selectively based on some heuristic though (that would be my guess).
- wruza 7y agoI guess it is about asyncing to a different isolate+thread, not multithreading a single one. Locking issues do not go away just because it is javascript, rust and 2020.
- doteka 7y agoNode does this as well AFAIK, IO operations are ran on a worker pool [1] [1] https://blog.logrocket.com/a-complete-guide-to-threads-in-node-js-4fa3898fe74f/ https://blog.logrocket.com/a-complete-guide-to-threads-in-no...
- crabmusket 7y agoI think it's likely that in this context, "ops" refers to the low level runtime primitives Deno provides and implements in Rust. E.g. read bytes from a file. I doubt you could transparently multithread `await` without clashing with JS's semantics.