News for hackers. Stuff that matters.
Re:How Rust Is Tilde’s Competitive Advantage [pdf] by kbenson on Wednesday February 07, 2018 @12:35AM (#16322431)
> async/await means you mark all your yield points explicitly; rather than having the runtime implicitly preempt you whenever it chooses, you mark the points at which task switching can happen, and at every other point it's impossible (equivalently it's as though any block of code that doesn't contain an "await" were a critical section).

That's not how I understood it at all. I always assumed that it just promoted explicitly acknowledging when the effect of an async block would be present, but that the normal yield points (traditionally syscalls and IO requests in OS threads) generally still held for the actual execution of the other code.

I mean, if we aren't allowing separate code paths to execute (and thus reducing wait on resources such as IO), what's the point?

Re:How Rust Is Tilde’s Competitive Advantage [pdf] by lmm on Wednesday February 07, 2018 @04:30AM (#16323256)
> That's not how I understood it at all. I always assumed that it just promoted explicitly acknowledging when the effect of an async block would be present, but that the normal yield points (traditionally syscalls and IO requests in OS threads) generally still held for the actual execution of the other code.

Put it this way: the language implementation won't preempt you except at your explicit yield points (some standard library functions for things like I/O will and should be yield points that you have to call with async/await). If the language implementation happens to be running as a userspace process on a preemptive multitasking OS then it will still be subject to the same preemption rules as any other userspace process on that OS, but if anything this is usually counterproductive (e.g. priority inversions are almost guaranteed); recommended practice when working in green-thread-based systems is to run with one thread per CPU core and maybe even pin threads to cores if the OS lets you do that, because the language's own M:N scheduling will keep those threads fully occupied and OS scheduling is only going to get in the way.

Re:How Rust Is Tilde’s Competitive Advantage [pdf] by kbenson on Wednesday February 07, 2018 @10:15AM (#16324901)
I think I see what's going on here. You're answering "in the context of Go" (which is correct, and what was corrected) and I'm interpreting it as a general statement about what async/await mean as general concepts (i.e. in other languages as well). My mistake, I wasn't paying close enough attention. :)
Re:How Rust Is Tilde’s Competitive Advantage [pdf] by kbenson on Wednesday February 07, 2018 @06:18PM (#16328871)
s/and what was corrected/and what was requested/ Ugh, so many typos or word mistakes lately. :/