5 ms·
From what I can tell, both solve different problems. There are times when one might want async executors like node's event loop or rust's tokio/async-std, but
by andrewzah 6y ago
From what I can tell, both solve different problems.
There are times when one might want async executors like node's event loop or rust's tokio/async-std, but in other situations one might want os threads or "green threads" with a RwLock or Mutex.
What about a few long running threads that use async internally? ;-)
- dullgiulio 6y agoThat's the Go runtime.
- mumblemumble 6y agoThat's another thing that C# (or, rather, .NET) handles really well. I can't remember the exact syntax, but the Task API has a way of declaring a background task as "long-running". The key difference is, long-running tasks get a dedicated thread; short-running tasks execute on the thread pool.