2016-11-29, 12:01
(2016-11-28, 17:40)DaveBlake Wrote: I still need to understand why a UI, that's purpose is to display data, wants to do something other than wait for the data it is going to display to arrive before rendering?
There is a very big difference in waiting in terms of a synchronous blocking call or in an asynchronous way. If you do processing on the main thread, the application becomes unresponsive for the time of processing. It won't render and it won't accept any user input. That also means that you can't even display a busy dialog, the application is just dead during the time of processing. Background video or visualisations also dead.
Not long ago I fixed some issue where a DB operation was hooked into OnPlaybackStarted (or some announcements hooked into this callback). That call blocked the Raspberry Pi for approximately 4 seconds.
The solution is rather simple and can already be found in Kodi. Keep the application alive and wait asynchronously. Give the user also a chance to cancel the operation.