News for hackers. Stuff that matters.
Re:Fast, Safe, and Complete(ish) Web Service in Rust by zzzcpan on Tuesday March 27, 2018 @02:43PM (#16691519)
No. Implicitly yielding and getting scheduled back is exactly what synchronous sequence is. And it cannot ever be faster than asynchronous, because asynchronous doesn't yield. Any "rediscoveries" are just mistakes due to lack of fundamental understanding of these things.
Re:Fast, Safe, and Complete(ish) Web Service in Rust by masklinn on Tuesday March 27, 2018 @04:02PM (#16692222)
> No. Implicitly yielding and getting scheduled back is exactly what synchronous sequence is.

Your asynchronous system can be descheduled by the OS on top of the stuff it does on its own if it runs on a preemptive multitasking OS or hypervisor, which more or less all of them do.

> And it cannot ever be faster than asynchronous, because asynchronous doesn't yield.

The asynchronous system yields doubly, it yields to its own userland scheduler/event loop and it's de-scheduled by the preemptive multitasking OS it runs on top of.

Re:Fast, Safe, and Complete(ish) Web Service in Rust by zzzcpan on Tuesday March 27, 2018 @05:08PM (#16692734)
Any process or thread can be descheduled by the OS on top of the stuff it does on its own.

Yielding is a thing from the multithreaded world with synchronous APIs. Asynchronous systems don't yield, they are programmed asynchronously. They have no yielding overhead and can never be slower than yielding threads.

If you are arguing for 1:1 kernel threading against M:N threading (coroutines, goroutines, green threads) that's fine, but multithreading implementations have absolutely nothing to do with asynchronous systems.

Re:Fast, Safe, and Complete(ish) Web Service in Rust by zbentley on Tuesday March 27, 2018 @06:40PM (#16693467)
It seems like the two of you disagree fundamentally on what "asynchronous" means in this context.

https://en.wikipedia.org/wiki/Asynchrony_(computer_programmi...

Re:Fast, Safe, and Complete(ish) Web Service in Rust by zzzcpan on Tuesday March 27, 2018 @09:35PM (#16694451)
I don't think we disagree on that, since he explicitly mentions event loops and essentially claims they are generally slower. Which is nonsense.
Re:Fast, Safe, and Complete(ish) Web Service in Rust by rictic on Tuesday March 27, 2018 @03:34PM (#16691977)
All of these examples are running on preemptive multithreaded operating systems, so implicitly yielding and getting scheduled is in the cards even if your process is managing its own concurrency with cooperative multithreading.
Re:Fast, Safe, and Complete(ish) Web Service in Rust by k__ on Tuesday March 27, 2018 @02:48PM (#16691570)
So where are the benefits coming from in these "rediscoveries"?
Re:Fast, Safe, and Complete(ish) Web Service in Rust by zzzcpan on Tuesday March 27, 2018 @02:56PM (#16691658)
Sometimes async is not real async, but an emulation, this is where "rediscoveries" come in I suppose.