3 ms·
Does this still hold if you use async/await which simply would push a different task on the thread while the other one is waiting?
by tcfhgj 5y ago
Does this still hold if you use async/await which simply would push a different task on the thread while the other one is waiting?
- marginalia_nu 5y agoAs far as the operating system is concerned, a thread is a thread. Async/await is a pattern for hiding the implementation details of multitasking or faking it in languages with limited support, it still largely works the same, except you see it as the thread being yielded to rather than from in explicit threading.
- zozbot234 5y agoAsync-await uses non-blocking operations in the kernel. If blocking operations need to occur, then these can occur on a separate thread but this is rare. Most things have a non-blocking equivalent.
- preseinger 5y agoAsync/await is an abstraction that exists at a layer above OS threads. "Non-blocking" isn't well defined when speaking about OS threading models.