4 ms·
To be fair, UI applications on most platforms that are not Windows or Linux have a very similar problem, you can't simply block the event loop for a few seconds
by flohofwoe 6y ago
To be fair, UI applications on most platforms that are not Windows or Linux have a very similar problem, you can't simply block the event loop for a few seconds or the whole UI will freeze and the OS will most likely terminate the application (on mobile at last). Usually one can workaround this with threads, alas, threading in the browser environment opens up a whole new can of worms.
Asynchronous programming is a different coding mindset, and async-await provides a convenient hack/workaround/solution to go back to a simple linear execution flow (even if that's just an "illusion"). But this problem had been solved many decades ago on the OS level in UNIX and other multitasking operating systems already (and solved it much better, because async-await is essentially cooperative multitasking, like in Windows 3.x or classic MacOS).