3 ms·
To be fair, blocking the UI thread is still a common issue in desktop app programming, where it’s been a well-known thing for at least 1-2 decades longer. You
by moregrist 2y ago
To be fair, blocking the UI thread is still a common issue in desktop app programming, where it’s been a well-known thing for at least 1-2 decades longer.
You either have to split linear execution (hard although async can make this easier in languages like Python) or go multithreaded with its own difficulties.
But IME what typically happens, at least in desktop apps, is that doing a little work in the UI thread is fine until it isn’t, and the “not fine” moment can be months or years away from when the code is written. The bug reports are often vague and rare enough that it takes a while to see the pattern (eg: “it froze and then I killed the program”). And after enough of these problems, someone with experience puts a framework and some rules in place that move tasks off the UI thread. Which works until they creep back in.