Continuation on heap vs thread context switch

I am not a Darwin kernel engineer, so take my answer with a grain of salt.

Thread Switching involves the kernel, which requires costly context switches and a bunch of busywork which may or may not be needed, but has to be done.
Async/Await Tasks are scheduled & switched without having to hop into the kernel, and therefore are much faster & efficient in terms of CPU cycles & memory usage.

1 Like