Thanks for the response, @DTS Engineer, Quinn.
Additional context: We are working on a cross-platform application that is primarily written in C++ (missed to mention this in the first line of the post).
There isn’t a supported way to block the main thread of a GUI application for long periods of time. On macOS it will SPOD, which is a terrible user experience. On other platforms the app will likely end up being killed by the watchdog.
I understand that, in macOS, holding the main thread prevents it from picking up user events, thus, causing the SPOD experience (which is bad). In iOS, the process itself is terminated after 5 sec (please correct if not true).
That's why the choice was to hold the main thread on a timed-wait interface instead of indefinite wait, which leads to SPOD, app termination etc. Basically, we don't intend to block the main thread for long periods of time. The duration of the timer is expected to be in milliseconds. Main thread is never expected to timeout.
So, it should be fine to hold the main thread on a timed-wait? For some microseconds (in the worst case, handful of milliseconds), main thread won't be available for UI events. Please let us know of the consequences of this choice. I mean, is it against the AppStore policy or something else we don't know?
PS: We intend to use this design of very brief timed-wait of main thread on other platforms (Android, Windows etc.) as well and there are no problems so far.
Topic:
App & System Services
SubTopic:
Core OS
Tags: