4 ms·
>> So really when you use async/await, you’re just writing pseudo-sequential code that gets turned into callback code. Small nitpick: I wouldn't call it "pseu
by bheadmaster 3y ago
>> So really when you use async/await, you’re just writing pseudo-sequential code that gets turned into callback code.
Small nitpick:
I wouldn't call it "pseudosequential", personally. By that logic, C is pseudosequential, because when you call a system call, your process state gets saved in the scheduler, control gets passed to the kernel, then when kernel finishes, your process state is resumed. Not even getting started on branch prediction and similar CPU optimizations.
What I mean is, as long as you have a kernel and scheduling, there's no such thing as a real (userspace) sequential program. We just call them sequential because their side effects correspond to a sequential model of execution. So if the side effects of an async/await program corresponds to that of a sequential model, it's a sequential program.
But I get the value of using that word for an explanation of the implementation.