ratish
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2017
03:23 AM
calling roDateTime in Main Thread throws Execution timeout
Hi
I am creating roDateTime in Main Thread and calling its function a a loop of 700 iterations. App is throwing Execution Timeout. Nowhere its documented that calling roDateTime function is expensive. Is calling this function 700 times in Main Thread( UX Thread) unsafe?
I am creating roDateTime in Main Thread and calling its function a a loop of 700 iterations. App is throwing Execution Timeout. Nowhere its documented that calling roDateTime function is expensive. Is calling this function 700 times in Main Thread( UX Thread) unsafe?
3 REPLIES 3
NB_
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2017
10:10 AM
Re: calling roDateTime in Main Thread throws Execution timeout
Don't call the render thread a "main thread" - that causes confusion, since there is also the app thread - the one that creates roSgScreen and it's render thread - that one is even main-er 🙂
You shall NOT block the render thread for a long periods of time, ever. Every call on it is supposed to finish well under 17ms, so that it can redraw the screen 60 times per second. If you "hog" it, you are hurting the UI - and if you do that for long (>3sec), the OS will kill the app. The long-running jobs should be done in a task thread or in the app thread.
You shall NOT block the render thread for a long periods of time, ever. Every call on it is supposed to finish well under 17ms, so that it can redraw the screen 60 times per second. If you "hog" it, you are hurting the UI - and if you do that for long (>3sec), the OS will kill the app. The long-running jobs should be done in a task thread or in the app thread.
ratish
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2017
08:24 PM
Re: calling roDateTime in Main Thread throws Execution timeout
Thanks. Will take care of it. Wondering how it worked before 7.6 firmware update. It all started throwing this timeout after 7.6 firmware update.
NB_
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2017
01:35 PM
Re: calling roDateTime in Main Thread throws Execution timeout
Enforcing render thread timeout may have started in 7.6, i don't know the detail on that. But app code (ab)using the render thread for a long, uninterrupted time has always been a bad idea, regardless if we were policing it 8-) - it leads to irresponsive UI, simple as that - player seems "hanging"