News for hackers. Stuff that matters.
Re:Tokio 1.0 – async runtime for Rust by lumost on Wednesday December 23, 2020 @07:09PM (#25523794)
I really don't understand the logic of this on a multi-threaded system. The vast majority of functions I write are best executed synchronously, the remainder is usually composed of logic wrapping heavy computations which can be executed in parallel or logic surrounding I/O which can be executed concurrently.

An async system which poisons the rest of my code to force async usage doesn't seem like it will scale to code leveraging multiple libraries and will likely fail at the first lib where the author decided not to bother. The beauty of coroutines in go and Java(soon) is that the async functionality remains local to the code that can make use of it - everyone else just sees a thread-like API.

Re:Tokio 1.0 – async runtime for Rust by lmm on Wednesday December 23, 2020 @11:43PM (#25525113)
I think you're right on one level: if your codebase is pervasively, implicitly multithreaded, then there's little value in explicitly marking yield points. But if your codebase is pervasively, implicitly multithreaded, then it's impossible to maintain without locking everywhere (and difficult even then), and combining async with (blocking) locking does not work well.

In a codebase where concurrency is carefully controlled and constrained, an async system that gives you visibility into where the yield points are is very valuable: https://glyph.twistedmatrix.com/2014/02/unyielding.html .

Re:Tokio 1.0 – async runtime for Rust by dboreham on Thursday December 24, 2020 @11:02AM (#25528626)
> An async system which poisons the rest of my code to force async usage doesn't seem like it will scale to code leveraging multiple libraries and will likely fail at the first lib where the author decided not to bother.

You are quite correct. This happens.

Re:Tokio 1.0 – async runtime for Rust by mst on Thursday December 24, 2020 @02:01PM (#25530311)
> logic surrounding I/O which can be executed concurrently.

That's the bit you'd use an async runtime for, in a (mostly) dedicated thread.

The heavy computations would be in other threads that aren't doing so.